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

[FEA] groupby.agg() support for controlling output columns #12411

Open
mattf opened this issue Dec 17, 2022 · 0 comments
Open

[FEA] groupby.agg() support for controlling output columns #12411

mattf opened this issue Dec 17, 2022 · 0 comments
Labels
feature request New feature or request Python Affects Python cuDF API.

Comments

@mattf
Copy link

mattf commented Dec 17, 2022

Is your feature request related to a problem? Please describe.
rewriting code with import cudf as pd

Describe the solution you'd like

>>> import cudf as pd
>>> pd.__version__
'22.12.01'

>>> df = 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]})
>>> df
  kind  height  weight
0  cat     9.1     7.9
1  dog     6.0     7.5
2  cat     9.5     9.9
3  dog    34.0   198.0

>>> df.to_pandas().groupby('kind').agg(min_height=('height', 'min'), max_weight=('weight', 'max'))
      min_height  max_weight
kind                        
cat          9.1         9.9
dog          6.0       198.0

>>> df.groupby('kind').agg(min_height=('height', 'min'), max_weight=('weight', 'max'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../python3.8/contextlib.py", line 75, in inner
    return func(*args, **kwds)
TypeError: agg() got an unexpected keyword argument 'min_height'

references:

@mattf mattf added Needs Triage Need team to review and classify feature request New feature or request labels Dec 17, 2022
@shwina shwina added Python Affects Python cuDF API. and removed Needs Triage Need team to review and classify labels Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request Python Affects Python cuDF API.
Projects
Status: No status
Development

No branches or pull requests

3 participants