Skip to content

Commit 34d7a58

Browse files
theMoggetKevin D Smith
authored and
Kevin D Smith
committed
TST: test for expanding window with min_periods GH25857 (pandas-dev#37131)
1 parent 103c9ab commit 34d7a58

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/window/test_expanding.py

+8
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ def test_expanding_count_default_min_periods_with_null_values(constructor):
137137
tm.assert_equal(result, expected)
138138

139139

140+
@pytest.mark.parametrize("constructor", [Series, DataFrame])
141+
def test_expanding_count_with_min_periods_exceeding_series_length(constructor):
142+
# GH 25857
143+
result = constructor(range(5)).expanding(min_periods=6).count()
144+
expected = constructor([np.nan, np.nan, np.nan, np.nan, np.nan])
145+
tm.assert_equal(result, expected)
146+
147+
140148
@pytest.mark.parametrize(
141149
"df,expected,min_periods",
142150
[

0 commit comments

Comments
 (0)