[FEA] Series.str.contains support for case
- 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
Assessment
This issue has not been assessed yet.