-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Named aggregation in SeriesGroupBy.agg #26580
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
ENH: Named aggregation in SeriesGroupBy.agg #26580
Conversation
```python In [4]: animals = pd.DataFrame({'kind': ['cat', 'dog', 'cat', 'dog'], ...: 'height': [9.1, 6.0, 9.5, 34.0], ...: 'weight': [7.9, 7.5, 9.9, 198.0]}) ...: animals.groupby("kind").height.agg(max_height='max') Out[4]: max_height kind cat 9.5 dog 34.0 ``` Closes pandas-dev#26512
Codecov Report
@@ Coverage Diff @@
## master #26580 +/- ##
==========================================
- Coverage 91.84% 91.84% -0.01%
==========================================
Files 174 174
Lines 50643 50656 +13
==========================================
+ Hits 46515 46524 +9
- Misses 4128 4132 +4
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #26580 +/- ##
==========================================
- Coverage 91.71% 91.71% -0.01%
==========================================
Files 178 178
Lines 50740 50755 +15
==========================================
+ Hits 46538 46548 +10
- Misses 4202 4207 +5
Continue to review full report at Codecov.
|
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.
small comments
@@ -331,6 +331,37 @@ def test_uint64_type_handling(dtype, how): | |||
|
|||
class TestNamedAggregation: |
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.
could make this a separate class
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.
You're saying split the series specific ones, into TestNamedAggregationSeries and TestNamedAggregationDataFrame?
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.
yes
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.
lgtm ex @jreback comments
can you merge master to ensure passing, otherwise lgtm. |
All green. |
thanks @TomAugspurger |
Closes #26512
git diff upstream/master -u -- "*.py" | flake8 --diff