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] Logical and (&&) and or (||) support. #1517

Closed
harrism opened this issue Apr 29, 2019 · 4 comments · Fixed by #1819
Closed

[FEA] Logical and (&&) and or (||) support. #1517

harrism opened this issue Apr 29, 2019 · 4 comments · Fixed by #1819
Labels
feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. Python Affects Python cuDF API.

Comments

@harrism
Copy link
Member

harrism commented Apr 29, 2019

Is your feature request related to a problem? Please describe.
Add C++ && and || binary operators to libcudf, and Python and and or binary operators to cudf

Describe the solution you'd like
Support performing logical operators between Series / columns

Additional context
#1142 adds a first-class Boolean type, so this functionality makes more sense now.

#1071 requested binary & and | but refers to them as "logical" operators, when they are actually bitwise operators. The bitwise operators have been implemented.

#49 appears to have requested this feature, but it was also interpreted as requesting bitwise operators.

@harrism harrism added feature request New feature or request Needs Triage Need team to review and classify labels Apr 29, 2019
@harrism harrism added Python Affects Python cuDF API. libcudf Affects libcudf (C++/CUDA) code. and removed Needs Triage Need team to review and classify labels Apr 29, 2019
@ButkiewiczP
Copy link

Hey @harrism , you're definitely technically correct when you say those are bitwise operators and that we should use logical operators instead, but just to provide context here, the reason those other issues request bitwise operators instead of the logical operators && and || is (I believe) because of how the pandas library handles boolean indexing. I personally think it would be confusing if cudf and pandas implemented boolean indexing differently, but I understand why it can be confusing.

@jrhemstad
Copy link
Contributor

Hey @harrism , you're definitely technically correct when you say those are bitwise operators and that we should use logical operators instead, but just to provide context here, the reason those other issues request bitwise operators instead of the logical operators && and || is (I believe) because of how the pandas library handles boolean indexing. I personally think it would be confusing if cudf and pandas implemented boolean indexing differently, but I understand why it can be confusing.

It looks like in Pandas | is equal to || in C++, likewise with & and &&. So really, the ask is just for the logical operators. The confusion is just an inconsistency between how Pandas and C++ names these operators.

@harrism
Copy link
Member Author

harrism commented May 9, 2019

Regardless of how the Python side chooses to expose them, we don't have the logical operators in libcudf today.

@devavret
Copy link
Contributor

devavret commented May 16, 2019

This can be added pretty quickly in JIT code. The python side might take some time.

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 libcudf Affects libcudf (C++/CUDA) code. Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants