[BUG] Groupby apply example returns different results between cudf and pandas
Open
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
Assessment
This issue has not been assessed yet.