-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: agg with axis=1 #19605
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
BUG: agg with axis=1 #19605
Changes from all commits
e5bbf22
66b8b9d
4b80516
f5698d5
1c076a2
5a261fc
054a13a
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 |
---|---|---|
|
@@ -1012,3 +1012,18 @@ def test_non_callable_aggregates(self): | |
expected = df.size | ||
|
||
assert result == expected | ||
|
||
def test_frame_row_and_column_aggregates(self): | ||
df = DataFrame({'B': [4, 5, 6, 7, 8], | ||
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. add the issue number as a comment. |
||
'C': [7, 8, 9, 10, 11]}, | ||
index=[1, 2, 3, 4, 5]) | ||
|
||
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 just adding a new test. ideally would like to systematically test all routines.
|
||
assert_series_equal(df.agg('min', axis=1), | ||
Series({1: 4, | ||
2: 5, | ||
3: 6, | ||
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. also add a test with mixed dtypes (note that they will generally be excluded on the agg so this works ok) |
||
4: 7, | ||
5: 8})) | ||
|
||
assert_series_equal(df.agg('min', axis=1), | ||
df.T.agg('min').T) |
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.
though would prefer to pass in axis and have it used down in the stack
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.
as .apply does generally work with axis=1, it is prob just not passed thru