NVIDIA / NVIDIA/cudf

[FEA] dask-cudf groupby with quantile and median methods

Open
#4,706 6 comments 0 reactions 0 assignees View on GitHub
dask feature request Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Is your feature request related to a problem? Please describe.**
I'd like to calculate median and/or quantile on a column after groupbying a dask-cudf data frame.

**EDIT** 5/10/2024: median is now implemented

**Describe the solution you'd like**
I want the following code to work and generate correct results:

```
cdf =cudf.DataFrame({'id4': 4*list(range(6)), 'id5': 4*list(reversed(range(6))), 'v3': 6*list(range(4))})
ddf = dcu.from_cudf(cdf, npartitions= 1)

ddf.dtypes
id4 int64
id5 int64
v3 int64
dtype: object

ddf.head()

id4 id5 v3

0 0 5 0
1 1 4 1
2 2 3 2
3 3 2 3
4 4 1 0

#these groupby operations do not work
ans = ddf.groupby(['id4', 'id5'])[['v3']].median().compute()

OR

ans = ddf.groupby(['id4', 'id5'])[['v3']].quantile(q=0.5).compute()
```

**Additional context**
I am using Rapids 0.13 nightly release in conda env, with dask 2.12.0 version.

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.