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

[FEA] Support element-wise not operator (~) on Bool columns #1504

Closed
beckernick opened this issue Apr 25, 2019 · 2 comments
Closed

[FEA] Support element-wise not operator (~) on Bool columns #1504

beckernick opened this issue Apr 25, 2019 · 2 comments
Labels
feature request New feature or request Python Affects Python cuDF API.

Comments

@beckernick
Copy link
Member

Is your feature request related to a problem? Please describe.
I'd like to be able to call ~series on Boolean series, like in pandas.

Describe the solution you'd like

import cudf
import pandas as pd

s = cudf.Series([True, False, False])
ps = s.to_pandas()

print(ps)
print(~ps)
print(~s)
0     True
1    False
2    False
dtype: bool
0    False
1     True
2     True
dtype: bool
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-292-c58f31f5ac53> in <module>
      7 print(ps)
      8 print(~ps)
----> 9 print(~s)

/conda/envs/cudf/lib/python3.7/site-packages/cudf-0.7.0.dev0+565.gf6ad6de.dirty-py3.7-linux-x86_64.egg/cudf/dataframe/series.py in __invert__(self)
    573         else:
    574             raise TypeError(
--> 575                 f"Operation `~` not supported on {self.dtype.type.__name__}"
    576             )
    577 

TypeError: Operation `~` not supported on bool_
@beckernick beckernick added feature request New feature or request Needs Triage Need team to review and classify labels Apr 25, 2019
@beckernick beckernick changed the title [FEA] Support logical not operator (~) on Bool columns [FEA] Support not operator (~) on Bool columns Apr 25, 2019
@beckernick beckernick changed the title [FEA] Support not operator (~) on Bool columns [FEA] Support element-wise not operator (~) on Bool columns Apr 25, 2019
@harrism
Copy link
Member

harrism commented Apr 26, 2019

Should be supported on C++ side if not now then after #1142.

@kkraus14 kkraus14 added Python Affects Python cuDF API. and removed Needs Triage Need team to review and classify labels May 13, 2019
@beckernick
Copy link
Member Author

Resolved. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request Python Affects Python cuDF API.
Projects
None yet
Development

No branches or pull requests

3 participants