-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
REGR: Resampler.aggregate fails when used with column selection #43410
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
36fc092
7266e1a
cfba2b4
fb12d40
061988d
022ee2f
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 |
---|---|---|
|
@@ -406,6 +406,21 @@ def test_resample_groupby_agg(): | |
tm.assert_frame_equal(result, expected) | ||
|
||
|
||
def test_resample_groupby_agg_listlike(): | ||
# GH 42905 | ||
ts = Timestamp("2021-02-28 00:00:00") | ||
df = DataFrame({"class": ["beta"], "value": [69], "date": [ts]}) | ||
result = ( | ||
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. nit. can you make the result assignment just the op under test. |
||
df.set_index("date") | ||
.groupby("class") | ||
.resample("M")["value"] | ||
.agg(["sum", "size"]) | ||
) | ||
index = pd.MultiIndex.from_tuples([("beta", ts)], names=["class", "date"]) | ||
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. another nit. |
||
expected = DataFrame([[69, 1]], index=index, columns=["sum", "size"]) | ||
tm.assert_frame_equal(result, expected) | ||
|
||
|
||
@pytest.mark.parametrize("keys", [["a"], ["a", "b"]]) | ||
def test_empty(keys): | ||
# GH 26411 | ||
|
Uh oh!
There was an error while loading. Please reload this page.