NVIDIA / NVIDIA/cudf

[FEA] Support `cut` and `qcut` in cudf-polars

Open
#20,545 0 comments 0 reactions 0 assignees View on GitHub
cudf-polars feature request
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

```python
import polars as pl
pl.Config.set_verbose(True)
ser = pl.Series('foo', [-2, -1, 0, 1, 2])

# cut
print(
pl.LazyFrame(ser)
.with_columns(pl.col("foo").cut([-1, 1], labels=["a", "b", "c"]).alias("cut"))
.collect(engine='gpu')
)
"""
/opt/miniconda3_py312/lib/python3.12/site-packages/polars/lazyframe/frame.py:2407: PerformanceWarning: Query execution with GPU not possible: unsupported operations.
The errors were:
- NotImplementedError: dtype=Categorical conversion not supported
return wrap_df(ldf.collect(engine, callback))
shape: (5, 2)
┌─────┬─────┐
│ foo ┆ cut │
│ --- ┆ --- │
│ i64 ┆ cat │
╞═════╪═════╡
│ -2 ┆ a │
│ -1 ┆ a │
│ 0 ┆ b │
│ 1 ┆ b │
│ 2 ┆ c │
└─────┴─────┘
"""

# qcut
print(
pl.LazyFrame(ser)
.with_columns(pl.col("foo").qcut([0.25, 0.75], labels=["a", "b", "c"]).alias("qcut"))
.collect(engine='gpu')
)
"""
/opt/miniconda3_py312/lib/python3.12/site-packages/polars/lazyframe/frame.py:2407: PerformanceWarning: Query execution with GPU not possible: unsupported operations.
The errors were:
- NotImplementedError: dtype=Categorical conversion not supported
return wrap_df(ldf.collect(engine, callback))
shape: (5, 2)
┌─────┬──────┐
│ foo ┆ qcut │
│ --- ┆ --- │
│ i64 ┆ cat │
╞═════╪══════╡
│ -2 ┆ a │
│ -1 ┆ a │
│ 0 ┆ b │
│ 1 ┆ b │
│ 2 ┆ c │
└─────┴──────┘
"""

```

The cudf-polars version is '25.12.00a350'

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.