Skip to content
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

Allow Keyword aggregation in SeriesGroupBy #26512

Closed
TomAugspurger opened this issue May 24, 2019 · 0 comments · Fixed by #26580
Closed

Allow Keyword aggregation in SeriesGroupBy #26512

TomAugspurger opened this issue May 24, 2019 · 0 comments · Fixed by #26580
Labels
Blocker Blocking issue or pull request for an upcoming release Groupby
Milestone

Comments

@TomAugspurger
Copy link
Contributor

Followup to #26399

In [1]: df = pd.DataFrame({'A': [1, 1, 1, 2, 2], 
   ...:                      'B': range(5), 
   ...:                      'C': range(5)})                                    

In [2]: df                                     
Out[2]: 
   A  B  C
0  1  0  0
1  1  1  1
2  1  2  2
3  2  3  3
4  2  4  4

In [3]: df.groupby('A').B.agg(foo='count')                                                        
Out[3]: 
   foo
A     
1    3
2    2

#26399 (review)

@TomAugspurger TomAugspurger added the DataFrame DataFrame data structure label May 24, 2019
@TomAugspurger TomAugspurger added this to the 0.25.0 milestone May 24, 2019
@TomAugspurger TomAugspurger added Blocker Blocking issue or pull request for an upcoming release Groupby and removed DataFrame DataFrame data structure labels May 24, 2019
TomAugspurger added a commit to TomAugspurger/pandas that referenced this issue May 30, 2019
```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
TomAugspurger added a commit to TomAugspurger/pandas that referenced this issue May 30, 2019
```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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocker Blocking issue or pull request for an upcoming release Groupby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant