The Wayback Machine - https://web.archive.org/web/20210705020501/https://github.com/rapidsai/cudf/issues/8519
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

Open
esnvidia opened this issue Jun 15, 2021 · 0 comments

Comments

@esnvidia
Copy link

@esnvidia esnvidia commented Jun 15, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment