I create an array of size 50 for example without any value, then I insert let's say 3 values in it at random indexes and then I want to fill the rest of the array by interpolating between those values.
First I create my array:
n = 50
a = [None]*n
which give me an "empty array" of 50 slots:
[None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None]
then I replace manually several "None" randomly chosen with values:
a.pop(0)
a.insert(0,0)
a.pop(10)
a.insert(10,50)
a.pop(49)
a.insert(49,25000)
which give this:
[0, None, None, None, None, None, None, None, None, None, 50, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, 25000]
How can I fill the rest of the array, meaning replacing the "Nones" by actual values calculated by linear interpolation between the values I manually added in my array ?