When using pandas interpolate() to fill NaN values like this:
In [1]: s = pandas.Series([np.nan, np.nan, 1, np.nan, 3, np.nan, np.nan])
In [2]: s.interpolate()
Out[2]:
0 NaN
1 NaN
2 1
3 2
4 3
5 3
6 3
dtype: float64
In [3]: pandas.version.version
Out[3]: '0.16.2'
, why does pandas replace the values at index 5 and 6 with 3s, but leave the values at 0 and 1 as is?
Can I change this behavior? I'd like to leave NaN at index 5 and 6.
(Actually, I'd like it to do linearly extrapolate to fill all of 0, 1, 5, and 6, but that's kind of a different question. Bonus points if you answer it too!)