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

Fix GroupBy.apply doc examples rendering #12994

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions python/cudf/cudf/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -1148,16 +1148,19 @@ def mult(df):
``engine='jit'`` may be used to accelerate certain functions,
initially those that contain reductions and arithmetic operations
between results of those reductions:
>>> import cudf
>>> df = cudf.DataFrame({'a':[1,1,2,2,3,3], 'b':[1,2,3,4,5,6]})
>>> df.groupby('a').apply(
... lambda group: group['b'].max() - group['b'].min(),
... engine='jit'
... )
a None
0 1 1
1 2 1
2 3 1

..code-block:: python

import cudf
df = cudf.DataFrame({'a':[1,1,2,2,3,3], 'b':[1,2,3,4,5,6]})
df.groupby('a').apply(
lambda group: group['b'].max() - group['b'].min(),
engine='jit'
)
a None
0 1 1
1 2 1
2 3 1
brandon-b-miller marked this conversation as resolved.
Show resolved Hide resolved
"""
if not callable(function):
raise TypeError(f"type {type(function)} is not callable")
Expand Down