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

[BUG] Groupby apply on a series does not retain series name #8899

Closed
beckernick opened this issue Jul 29, 2021 · 0 comments · Fixed by #8939
Closed

[BUG] Groupby apply on a series does not retain series name #8899

beckernick opened this issue Jul 29, 2021 · 0 comments · Fixed by #8939
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@beckernick
Copy link
Member

Groupby.apply on a specific column does not preserve the name of the series for the output. Example drawn form #8898 .

import cudf
import numpy as npnp.random.seed(12)
​
nrows = 1000000
nkeys = 100keycol = np.random.choice(range(nkeys), nrows)
​
df = cudf.DataFrame({
    "key": keycol,
    "a": np.random.randint(0, 1000, nrows),
})
pdf = df.to_pandas()
​
print(
    pdf.groupby("key").a.apply(mean_minus_deduped_std).name,
    df.groupby("key").a.apply(mean_minus_deduped_std).name
)
a None```

!conda list | grep "cudf|pandas|numpy|arrow"
arrow-cpp 4.0.1 py38hf0991f3_4_cuda conda-forge
arrow-cpp-proc 3.0.0 cuda conda-forge
cudf 21.08.00a210723 cuda_11.2_py38_ga69a8a43b5_324 rapidsai-nightly
cudf_kafka 21.08.00a210723 py38_ga69a8a43b5_324 rapidsai-nightly
dask-cudf 21.08.00a210723 py38_ga69a8a43b5_324 rapidsai-nightly
geopandas 0.9.0 pyhd8ed1ab_1 conda-forge
geopandas-base 0.9.0 pyhd8ed1ab_1 conda-forge
libcudf 21.08.00a210723 cuda11.2_ga69a8a43b5_324 rapidsai-nightly
libcudf_kafka 21.08.00a210723 ga69a8a43b5_324 rapidsai-nightly
numpy 1.21.1 py38h9894fe3_0 conda-forge
pandas 1.2.5 py38h1abd341_0 conda-forge
pyarrow 4.0.1 py38hb53058b_4_cuda conda-forge

@beckernick beckernick added bug Something isn't working Python Affects Python cuDF API. labels Jul 29, 2021
@charlesbluca charlesbluca self-assigned this Aug 3, 2021
@rapids-bot rapids-bot bot closed this as completed in #8939 Aug 9, 2021
rapids-bot bot pushed a commit that referenced this issue Aug 9, 2021
Closes #8899 

Applies the name of `SeriesGroupby.obj` to the results of a `SeriesGroupby.apply()` operation; originally, this would be left as `None`.

Authors:
  - Charles Blackmon-Luca (https://github.com/charlesbluca)

Approvers:
  - Sheilah Kirui (https://github.com/skirui-source)
  - Michael Wang (https://github.com/isVoid)

URL: #8939
shwina pushed a commit to shwina/cudf that referenced this issue Aug 9, 2021
Closes rapidsai#8899 

Applies the name of `SeriesGroupby.obj` to the results of a `SeriesGroupby.apply()` operation; originally, this would be left as `None`.

Authors:
  - Charles Blackmon-Luca (https://github.com/charlesbluca)

Approvers:
  - Sheilah Kirui (https://github.com/skirui-source)
  - Michael Wang (https://github.com/isVoid)

URL: rapidsai#8939
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants