Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] clip not implemented for Dask-cuDF #17502

Closed
sarahyurick opened this issue Dec 3, 2024 · 1 comment · Fixed by #17509
Closed

[BUG] clip not implemented for Dask-cuDF #17502

sarahyurick opened this issue Dec 3, 2024 · 1 comment · Fixed by #17509
Assignees
Labels
bug Something isn't working dask Dask issue

Comments

@sarahyurick
Copy link
Contributor

With Pandas and CPU Dask, I can do:

import pandas as pd
import dask.dataframe as dd

data = {
    "id": ["a", "b", "c", "d"],
    "score": [-0.5, 0.5, 4.5, 5.5]
}
pdf = pd.DataFrame(data)
ddf = dd.from_pandas(pdf, npartitions=2)

ddf["score"] = (
    ddf["score"].clip(lower=0, upper=5).round().astype(int)
)

which works as expected. However, with cuDF and Dask-cuDF:

import cudf
import dask_cudf

data = {
    "id": ["a", "b", "c", "d"],
    "score": [-0.5, 0.5, 4.5, 5.5]
}
cdf = cudf.DataFrame(data)
ddf = dask_cudf.from_cudf(cdf, npartitions=2)

ddf["score"] = (
    ddf["score"].clip(lower=0, upper=5).round().astype(int)
)

it fails with:

NotImplementedError: `axis is not yet supported in clip`

cc @VibhuJawa

@sarahyurick sarahyurick added the bug Something isn't working label Dec 3, 2024
@VibhuJawa
Copy link
Member

CC: @rjzamora

@rjzamora rjzamora mentioned this issue Dec 4, 2024
3 tasks
@Matt711 Matt711 added the dask Dask issue label Dec 4, 2024
rapids-bot bot pushed a commit that referenced this issue Dec 10, 2024
Closes #17502

**Background Info**: The cudf and pandas `axis` defaults are different, and the upstream dask-expr `clip` APIs are consistent with the behavior of Pandas (not cudf).

Authors:
  - Richard (Rick) Zamora (https://github.com/rjzamora)
  - Matthew Murray (https://github.com/Matt711)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #17509
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dask Dask issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants