From 02544291c89cbf9c5ef1b9a815694bf3f1b1c29b Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Wed, 18 Mar 2020 10:48:52 -0700 Subject: [PATCH] plumb .str.find_multiple to python layer --- python/cudf/cudf/core/column/string.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python/cudf/cudf/core/column/string.py b/python/cudf/cudf/core/column/string.py index bc401266e58..41b689ca97b 100644 --- a/python/cudf/cudf/core/column/string.py +++ b/python/cudf/cudf/core/column/string.py @@ -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, @@ -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