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 floats using integer lower/upper bounds in a Series or DataFrame fails #8519

Closed
esnvidia opened this issue Jun 15, 2021 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers Python Affects Python cuDF API.

Comments

@esnvidia
Copy link

Describe the bug
Clipping a DataFrame or Series using ints causes a cudf Failure because it won't handle the different dtypes (int and float)

Steps/Code to reproduce bug

data = cudf.Series([-0.43, 0.1234, 1.5, -1.31])
data.clip(0, 1)

...
  File "cudf/_lib/replace.pyx", line 216, in cudf._lib.replace.clip
  File "cudf/_lib/replace.pyx", line 198, in cudf._lib.replace.clamp
RuntimeError: cuDF failure at: ../src/replace/clamp.cu:250: mismatching types of scalar and input

Meanwhile the following will work

data.clip(0., 1.)

Expected behavior
data.clip(0, 1)
Out:
0 0.0000
1 0.1234
2 1.0000
3 0.0000
dtype: float64

will coerce the integer upper/lower bounds to the float data.

Environment overview (please complete the following information)
conda install rapids-0.19

@esnvidia esnvidia added Needs Triage Need team to review and classify bug Something isn't working labels Jun 15, 2021
@shwina shwina added Python Affects Python cuDF API. good first issue Good for newcomers and removed Needs Triage Need team to review and classify labels Jun 16, 2021
@vyasr
Copy link
Contributor

vyasr commented Aug 1, 2022

This no longer fails on cudf 22.08:

>>> data = cudf.Series([-0.43, 0.1234, 1.5, -1.31])
>>> data.clip(0, 1)
0    0.0000
1    0.1234
2    1.0000
3    0.0000
dtype: float64

@vyasr vyasr closed this as completed Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers Python Affects Python cuDF API.
Projects
None yet
Development

No branches or pull requests

3 participants