I need to interpolate and find the values of a bunch of numbers
x=np.linspace(0,1.1,23)
y=[1.00,0,0.90,0,0.82,0,0.74,0,0.67,0,0.61,0,0.55,0,0.50,0,0.44,0,0.41,0,0.37,0,0.33]
So the values of points x=0,1.1,1.2 etc are known and for points 0.05,0.15,0.25 etc are unknown and i have put them in the list as 0.
Here is my further code:
i=1
for i in t1:
m=(x[i+1]-x[i-1])/(t1[i+1]-t1[i-1])
y=x[i-1]+m*(t1[i]-t1[i-1])
x1[i]=y
i=i+2
print(x1)
But i am getting this error:
TypeError: list indices must be integers or slices, not numpy.float64
How do i fix this?