I get this error: ValueError: A value in x_new is below the interpolation range. I believe this is because the very 1st value is a nan. Anyone knows how can I get around this?
I am trying this:
And I get this error:
ValueError: A value in x_new is below the interpolation range.
I believe this is because the very 1st value is a nan. Anyone knows how can I get around this?
My data has nans in the very beginning and I am happy to drop that part of the data.
y = np.array([float('nan'),2, float('nan'),4,float('nan'),5, float('nan'),float('nan'),11])
xnew = np.arange(len(y))
nan_idx = np.argwhere(np.isnan(y))
xold = np.delete(xnew,nan_idx)
yold = np.delete(y, nan_idx)
f = interp1d(xold,yold)
ynew = f(xnew)
And I get this error:
ValueError: A value in x_new is below the interpolation range.
I believe this is because the very 1st value is a nan. Anyone knows how can I get around this?
My data has nans in the very beginning and I am happy to drop that part of the data.
No any search results
You already invited:
1 Answers
Diane
Upvotes from: