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/8080 below:

expanding/rolling_apply() interpret min_periods=0 as min_periods=1 · Issue #8080 · pandas-dev/pandas · GitHub

expanding/rolling_apply() interpret min_periods=0 as min_periods=1. This is usually ok, as almost every function will return NaN when the inputs are all NaN. However, this is not true, for example, of functions like len().

For example, I think that in the following calls, the results should be 1, 2, 2 and 1, 2, 3, respectively.

In [409]: rolling_apply(Series([None, None, None]), 2, lambda x: len(x), min_periods=0)
Out[409]:
0   NaN
1   NaN
2   NaN
dtype: float64

In [411]: expanding_apply(Series([None, None, None]), lambda x: len(x), min_periods=0)
Out[411]:
0   NaN
1   NaN
2   NaN
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