-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TST: Test aggregate with list values #25581 #47559
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
b3dc515
a0f1dcb
1fd0a93
0e208c8
3d3953d
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 |
---|---|---|
|
@@ -1413,3 +1413,14 @@ def test_multi_axis_1_raises(func): | |
gb = df.groupby("a", axis=1) | ||
with pytest.raises(NotImplementedError, match="axis other than 0 is not supported"): | ||
gb.agg(func) | ||
|
||
|
||
def test_agg_of_list(): | ||
# GH#25581 | ||
df1 = DataFrame([[20, "A"], [20, "B"], [30, "C"]]) | ||
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. Could you add the other cases from the issue too? 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. From the issue there are 3 other test cases than the one I originally added. I can add 2 of them, but the final test case still fails on the master with a different error message than in 1.4.1. |
||
result = df1.groupby(0).agg(Series.mode) | ||
|
||
expected = DataFrame({0: [20, 30], 1: [["A", "B"], "C"]}) | ||
expected = expected.set_index(0) | ||
|
||
tm.assert_frame_equal(result, expected) |
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 add mode in the test name as well