Series interpolate failing if first index is NaN

24 views
Skip to first unread message

Nate Ron-Ferguson

unread,
Sep 27, 2016, 12:26:52 PM9/27/16
to PyData
I'm trying to work around a known bug in 1.18 that fails to generate a quantile for a series if there are null values by running interpolate on the column. However, interpolate doesn't seem to adjust null values that happen to fall in the first index position of the series. For example:

>>> test = pd.Series([np.nan, 1,3,3,1])

>>> test.interpolate()
0    NaN
1    1.0
2    3.0
3    3.0
4    1.0
dtype: float64

>>> test2 = pd.Series([np.nan, 1,3,3,1,np.nan])

>>> test2.interpolate()
0    NaN
1    1.0
2    3.0
3    3.0
4    1.0
5    1.0
dtype: float64

 

I couldn't seem to find anything that addresses this and was curious as to whether anyone else has come across this and maybe came up with a workaround to the workaround.
Reply all
Reply to author
Forward
0 new messages