NVIDIA / NVIDIA/cudf

[BUG] Groupby apply example returns different results between cudf and pandas

Open
#17,484 0 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**
See the repro

**Steps/Code to reproduce bug**
cudf:
```python
import cudf

df = cudf.DataFrame([[1, 2], [1, 4], [5, 6]], columns=["A", "B"])
result = df.groupby("A", as_index=False)["B"].apply(lambda x: x.cumsum())
print(result)
print(type(result))
```
```
index B
0 0 2
1 1 6
2 2 6

```

```python
import pandas as pd

df = pd.DataFrame([[1, 2], [1, 4], [5, 6]], columns=["A", "B"])
result = df.groupby("A", as_index=False)["B"].apply(lambda x: x.cumsum())
print(result)
print(type(result))
```
```
0 0 2
1 6
1 2 6
Name: B, dtype: int64

```

**Expected behavior**
Not sure if pandas or cudf is better 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.