A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/11115 below:

interpolate erroneously fills NaNs at start of series when limit_direction == 'both' · Issue #11115 · pandas-dev/pandas · GitHub

PR #10691 had a bug in computing the NaN mask in certain cases.

Specifically, when a NaN occurs within limit of the beginning of the series and limit_direction is set to 'both', the interpolation code will erroneously interpolate these NaNs rather than masking them off.

From the PR:

In [43]: ser = pd.Series([np.nan, np.nan, 5, np.nan, np.nan, np.nan, 13])
In [44]: ser.interpolate(limit=1, limit_direction='both')
Out[44]: 
0     5
1     5
2     5
3     7
4   NaN
5    11
6    13
dtype: float64

This should actually give:

Out[44]: 
0     NaN
1     5
2     5
3     7
4   NaN
5    11
6    13
dtype: float64

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4