NVIDIA / NVIDIA/cudf

[BUG] `df.groupby(['a']).agg({'b': ['mean', 'mean']})` only produces a single column (as opposed to 2)

Open
#17,649 5 comments 0 reactions 0 assignees View on GitHub
bug Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Describe the bug**
A clear and concise description of what the bug is.

**Steps/Code to reproduce bug**

```
df = cudf.DataFrame({'a': [1,1,2], 'b': [4,5,6]})
df.groupby(['a']).agg({'b': ['mean', 'mean']})
```
outputs
```
b
mean
a
1 4.5
2 6.0
```

**Expected behavior**

what pandas does:
```python
b
mean mean
a
1 4.5 4.5
2 6.0 6.0
```

Spotted in [Narwhals](https://github.com/narwhals-dev/narwhals)

**Environment overview (please complete the following information)**
- Environment location: [Bare-metal, Docker, Cloud(specify cloud provider)]
- Method of cuDF install: [conda, Docker, or from source]
- If method of install is [Docker], provide `docker pull` & `docker run` commands used

24.10.01, google colab

**Environment details**
Please run and paste the output of the `cudf/print_env.sh` script here, to gather any other relevant environment details

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.