8000 DEPR: min_periods=None behavior for Rolling.count by mroeschke · Pull Request #36649 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

DEPR: min_periods=None behavior for Rolling.count #36649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Oct 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/master' into ref/rolling_count
  • Loading branch information
Matt Roeschke committed Sep 28, 2020
commit 42d6cfb02438138f55686859b7c84b553fd826e4
29 changes: 0 additions & 29 deletions pandas/tests/window/moments/test_moments_rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,35 +203,6 @@ def test_centered_axis_validation():
(DataFrame(np.ones((10, 10))).rolling(window=3, center=True, axis=2).mean())


def test_rolling_sum(raw, series, frame):
_check_moment_func(
np.nansum,
name="sum",
zero_min_periods_equal=False,
raw=raw,
series=series,
frame=frame,
)


@pytest.mark.filterwarnings("ignore:min_periods:DeprecationWarning")
def test_rolling_count(raw, series, frame):
counter = lambda x: np.isfinite(x).astype(float).sum()
_check_moment_func(
counter,
name="count",
has_min_periods=False,
fill_value=0,
raw=raw,
series=series,
frame=frame,
)


def test_rolling_mean(raw, series, frame):
_check_moment_func(np.mean, name="mean", raw=raw, series=series, frame=frame)


@td.skip_if_no_scipy
def test_cmov_mean():
# GH 8238
Expand Down
14 changes: 12 additions & 2 deletions pandas/tests/window/moments/test_moments_rolling_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
[
[np.mean, "mean", {}],
[np.nansum, "sum", {}],
[lambda x: np.isfinite(x).astype(float).sum(), "count", {}],
pytest.param(
lambda x: np.isfinite(x).astype(float).sum(),
"count",
{},
marks=pytest.mark.filterwarnings("ignore:min_periods:DeprecationWarning"),
),
[np.median, "median", {}],
[np.min, "min", {}],
[np.max, "max", {}],
Expand All @@ -33,7 +38,12 @@ def test_series(series, compare_func, roll_func, kwargs):
[
[np.mean, "mean", {}],
[np.nansum, "sum", {}],
[lambda x: np.isfinite(x).astype(float).sum(), "count", {}],
pytest.param(
lambda x: np.isfinite(x).astype(float).sum(),
"count",
{},
marks=pytest.mark.filterwarnings("ignore:min_periods:DeprecationWarning"),
),
[np.median, "median", {}],
[np.min, "min", {}],
[np.max, "max", {}],
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0