NVIDIA / NVIDIA/cudf

[FEA] Series.str.contains support for case

Open
#12,515 0 comments 0 reactions 0 assignees View on GitHub
0 - Backlog feature request Python strings
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Is your feature request related to a problem? Please describe.**
writing code with `import cudf as pd`

**Describe the solution you'd like**
same behavior as `import pandas as pd`
```
In [1]: import cudf as pd

In [2]: pd.__version__
Out[2]: '22.12.0'

In [3]: df = pd.DataFrame({'a': ['one', 'One', 'onE']})

In [4]: df.a.str.contains('one', case=False)
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
Cell In [4], line 1
----> 1 df.a.str.contains('one', case=False)

File ~/.local/lib/python3.9/site-packages/cudf/core/column/string.py:759, in StringMethods.contains(self, pat, case, flags, na, regex)
650 r"""
651 Test if pattern or regex is contained within a string of a Series or
652 Index.
(...)
756 dtype: bool
757 """ # noqa W605
758 if case is not True:
--> 759 raise NotImplementedError("`case` parameter is not yet supported")
760 if na is not np.nan:
761 raise NotImplementedError("`na` parameter is not yet supported")

NotImplementedError: `case` parameter is not yet supported

In [5]: df.to_pandas().a.str.contains('one', case=False)
Out[5]:
0 True
1 True
2 True
Name: a, dtype: bool
```

**Additional context**
https://pandas.pydata.org/docs/reference/api/pandas.Series.str.contains.html

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.