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

[WIP] Enabling .str.find_multiple with new libcudf implementation #4575

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions python/cudf/cudf/core/column/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
rfind as cpp_rfind,
startswith as cpp_startswith,
)
from cudf._libxx.strings.find_multiple import (
find_multiple as cpp_find_multiple,
)
from cudf._libxx.strings.findall import findall as cpp_findall
from cudf._libxx.strings.padding import (
PadSide,
Expand Down Expand Up @@ -1506,6 +1509,12 @@ def startswith(self, pat, **kwargs):

return self._return_or_inplace(result_col, **kwargs)

def find_multiple(self, strs, **kwargs):
result_col = cpp_find_multiple(
self._column, column.as_column(strs, dtype="str")
)
return self._return_or_inplace(result_col, **kwargs)

def find(self, sub, start=0, end=None, **kwargs):
"""
Return lowest indexes in each strings in the Series/Index
Expand Down