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

Notes convert to Pandas-compat #12641

Merged
merged 25 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ec44d78
Convert note
Touutae-lab Feb 3, 2023
9380cc1
Merge branch 'branch-23.08' into convert-notes
vyasr Jun 29, 2023
1de4d02
Apply suggestions from code review
Touutae-lab Jul 7, 2023
1aabdc5
add 2 more methode
Touutae-lab Jul 7, 2023
49da65e
Merge branch 'branch-23.08' into convert-notes
Touutae-lab Jul 7, 2023
42df201
Fix indentation
Touutae-lab Jul 15, 2023
0ddd9b3
Merge branch 'convert-notes' of github.com:Touutae-lab/cudf into conv…
Touutae-lab Jul 15, 2023
85b7e02
Merge branch 'branch-23.08' into convert-notes
Touutae-lab Jul 15, 2023
652ee50
Merge branch 'branch-23.08' into convert-notes
Touutae-lab Aug 13, 2023
09173ea
Revert Testcase back
Touutae-lab Oct 21, 2023
10498be
Convert note
Touutae-lab Feb 3, 2023
95f6ac3
Apply suggestions from code review
Touutae-lab Jul 7, 2023
7f6b9bd
add 2 more methode
Touutae-lab Jul 7, 2023
7e76dac
Fix indentation
Touutae-lab Jul 15, 2023
46577ee
Revert Testcase back
Touutae-lab Oct 21, 2023
032e5f1
Merge branch 'convert-notes' of https://github.com/Touutae-lab/cudf i…
invalid-email-address Oct 21, 2023
668a71f
Merge remote-tracking branch 'upstream/branch-24.04' into convert-notes
vyasr Jan 22, 2024
d1f5e2c
Undo incorrect new methods
vyasr Jan 22, 2024
c31df67
Fix a copyright
vyasr Jan 22, 2024
7804d60
Merge branch 'rapidsai:branch-24.02' into convert-notes
Touutae-lab Jan 23, 2024
9702db1
Merge remote-tracking branch 'upstream/branch-24.04' into convert-notes
vyasr Jan 23, 2024
e757a1c
Clean up docstring of append
vyasr Jan 23, 2024
8a04993
Merge remote-tracking branch 'upstream/branch-24.04' into convert-notes
vyasr Jan 23, 2024
b98203a
Merge branch 'branch-24.04' into convert-notes
vyasr Jan 23, 2024
86ee689
Remove change from dask (does not support the plugin)
vyasr Jan 23, 2024
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
10 changes: 5 additions & 5 deletions python/cudf/cudf/core/column/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,11 +620,6 @@ def sort_values(
-------
Series or Index with each list sorted

Notes
-----
Difference from pandas:
* Not supporting: `inplace`, `kind`

Examples
--------
>>> s = cudf.Series([[4, 2, None, 9], [8, 8, 2], [2, 1]])
Expand All @@ -633,6 +628,11 @@ def sort_values(
1 [2.0, 8.0, 8.0]
2 [1.0, 2.0]
dtype: list

.. pandas-compat::
**ListMethods.sort_values**

The ``inplace`` and ``kind`` arguments are currently not supported.
"""
if inplace:
raise NotImplementedError("`inplace` not currently implemented.")
Expand Down
107 changes: 58 additions & 49 deletions python/cudf/cudf/core/column/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,11 +594,6 @@ def extract(
for each group. If `expand=False` and `pat` has only one capture
group, then return a Series/Index.

Notes
-----
The `flags` parameter currently only supports re.DOTALL and
re.MULTILINE.

Examples
--------
>>> import cudf
Expand All @@ -625,6 +620,12 @@ def extract(
1 2
2 <NA>
dtype: object

.. pandas-compat::
**StringMethods.extract**

The `flags` parameter currently only supports re.DOTALL and
re.MULTILINE.
""" # noqa W605
if not _is_supported_regex_flags(flags):
raise NotImplementedError(
Expand Down Expand Up @@ -672,14 +673,6 @@ def contains(
pattern is contained within the string of each element of the
Series/Index.

Notes
-----
The parameters `case` and `na` are not yet supported and will
raise a NotImplementedError if anything other than the default
value is set.
The `flags` parameter currently only supports re.DOTALL and
re.MULTILINE.

Examples
--------
>>> import cudf
Expand Down Expand Up @@ -753,6 +746,15 @@ def contains(
3 True
4 <NA>
dtype: bool

.. pandas-compat::
**StringMethods.contains**

The parameters `case` and `na` are not yet supported and will
raise a NotImplementedError if anything other than the default
value is set.
The `flags` parameter currently only supports re.DOTALL and
re.MULTILINE.
""" # noqa W605
if na is not np.nan:
raise NotImplementedError("`na` parameter is not yet supported")
Expand Down Expand Up @@ -951,12 +953,6 @@ def replace(
A copy of the object with all matching occurrences of pat replaced
by repl.

Notes
-----
The parameters `case` and `flags` are not yet supported and will raise
a `NotImplementedError` if anything other than the default value
is set.

Examples
--------
>>> import cudf
Expand Down Expand Up @@ -986,6 +982,13 @@ def replace(
1 fuz
2 <NA>
dtype: object

.. pandas-compat::
**StringMethods.replace**

The parameters `case` and `flags` are not yet supported and will
raise a `NotImplementedError` if anything other than the default
value is set.
"""
if case is not None:
raise NotImplementedError("`case` parameter is not yet supported")
Expand Down Expand Up @@ -2769,11 +2772,6 @@ def partition(self, sep: str = " ", expand: bool = True) -> SeriesOrIndex:
DataFrame or MultiIndex
Returns a DataFrame / MultiIndex

Notes
-----
The parameter `expand` is not yet supported and will raise a
`NotImplementedError` if anything other than the default value is set.

See Also
--------
rpartition
Expand Down Expand Up @@ -2815,6 +2813,14 @@ def partition(self, sep: str = " ", expand: bool = True) -> SeriesOrIndex:
MultiIndex([('X', ' ', '123'),
('Y', ' ', '999')],
)

.. pandas-compat::
**StringMethods.partition**

The parameter `expand` is not yet supported and will raise a
`NotImplementedError` if anything other than the default
value is set.

"""
if expand is not True:
raise NotImplementedError(
Expand Down Expand Up @@ -3500,14 +3506,6 @@ def count(self, pat: str, flags: int = 0) -> SeriesOrIndex:
-------
Series or Index

Notes
-----
- `flags` parameter currently only supports re.DOTALL
and re.MULTILINE.
- Some characters need to be escaped when passing
in pat. e.g. ``'$'`` has a special meaning in regex
and must be escaped when finding this literal character.

Examples
--------
>>> import cudf
Expand Down Expand Up @@ -3539,6 +3537,15 @@ def count(self, pat: str, flags: int = 0) -> SeriesOrIndex:
>>> index = cudf.Index(['A', 'A', 'Aaba', 'cat'])
>>> index.str.count('a')
Int64Index([0, 0, 2, 1], dtype='int64')

.. pandas-compat::
**StringMethods.count**

- `flags` parameter currently only supports re.DOTALL
and re.MULTILINE.
- Some characters need to be escaped when passing
in pat. e.g. ``'$'`` has a special meaning in regex
and must be escaped when finding this literal character.
Touutae-lab marked this conversation as resolved.
Show resolved Hide resolved
""" # noqa W605
if isinstance(pat, re.Pattern):
flags = pat.flags & ~re.U
Expand Down Expand Up @@ -3570,11 +3577,6 @@ def findall(self, pat: str, flags: int = 0) -> SeriesOrIndex:
All non-overlapping matches of pattern or
regular expression in each string of this Series/Index.

Notes
-----
The `flags` parameter currently only supports re.DOTALL and
re.MULTILINE.

Examples
--------
>>> import cudf
Expand Down Expand Up @@ -3615,6 +3617,12 @@ def findall(self, pat: str, flags: int = 0) -> SeriesOrIndex:
1 []
2 [b, b]
dtype: list

.. pandas-compat::
**StringMethods.findall**

The `flags` parameter currently only supports re.DOTALL and
re.MULTILINE.
"""
if isinstance(pat, re.Pattern):
flags = pat.flags & ~re.U
Expand Down Expand Up @@ -3797,11 +3805,6 @@ def endswith(self, pat: str) -> SeriesOrIndex:
A Series of booleans indicating whether the given
pattern matches the end of each string element.

Notes
-----
`na` parameter is not yet supported, as cudf uses
native strings instead of Python objects.

Examples
--------
>>> import cudf
Expand All @@ -3818,6 +3821,12 @@ def endswith(self, pat: str) -> SeriesOrIndex:
2 False
3 <NA>
dtype: bool

.. pandas-compat::
**StringMethods.endswith**

`na` parameter is not yet supported, as cudf uses
native strings instead of Python objects.
"""
if pat is None:
raise TypeError(
Expand Down Expand Up @@ -4245,13 +4254,6 @@ def match(
-------
Series or Index of boolean values.

Notes
-----
Parameters `case` and `na` are currently not supported.
The `flags` parameter currently only supports re.DOTALL and
re.MULTILINE.


Examples
--------
>>> import cudf
Expand All @@ -4272,6 +4274,13 @@ def match(
1 True
2 True
dtype: bool

.. pandas-compat::
**StringMethods.match**

Parameters `case` and `na` are currently not supported.
The `flags` parameter currently only supports re.DOTALL and
re.MULTILINE.
"""
if case is not True:
raise NotImplementedError("`case` parameter is not yet supported")
Expand Down
Loading
Loading