I'm not sure the correct place to ask, but I'm trying to develop a simple function/algorithm that outputs a predicted number from a sequence of numbers (I have a background in Python, but little to no experience working with data prediction). More specifically, when there is only binary choice. I looked around online, but I'm really lost and couldn't quite find something discussing it:
Suppose there's a bunch of 1s and 0s in sequence, like:
0100010010111011010010001011010
Suppose there is some complex math pattern that is determining the sequence, even though it is unbeknownst to us observers. However we know for certain that this data is not random, and contains no anomalies.
What sort of function can be used to predict if the next digit is a 1 or 0?
For example:
01010101 -> the next digit predicted should be 0.
001100110011 -> the next digit predicted should be 0.
Is there some simple Python function (using numpy, pandas, etc.) that can predict the next 1 or 0, no matter the pattern?