-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
15819 rolling window on empty df #16431
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
Changes from 3 commits
9cbaef6
d31b983
5fb1170
670a33a
e913664
985522f
6007654
4a81a5e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -441,6 +441,20 @@ def test_closed(self): | |
with pytest.raises(ValueError): | ||
df.rolling(window=3, closed='neither') | ||
|
||
def test_empty_df_datetime_rolling_sum(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rather than making all separate tests, either use parametrize, or you can consolidate these into 2 tests for rolling (and 2 for expanding) e.g.
|
||
# Verifies that datetime rolling window can be applied to empty DataFrame | ||
# GH 15819 | ||
result = DataFrame().rolling('1s').sum() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cna you leave a comment here with the github issue number? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I have updated with a comment |
||
expected = DataFrame() | ||
tm.assert_frame_equal(result, expected) | ||
|
||
def test_empty_df_integer_rolling_sum(self): | ||
# Verifies that integer rolling window can be applied to empty DataFrame | ||
# GH 15819 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add the same tests for expanding (not that the expanding will raise for the time-aware, a separate issue, so xfail that one, put a ref to #16425 there). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add these as well (which are known working)
|
||
result = DataFrame().rolling(1).sum() | ||
expected = DataFrame() | ||
tm.assert_frame_equal(result, expected) | ||
|
||
|
||
class TestExpanding(Base): | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you move to the rolling bug fix section