Skip to content

DOC: Enforce Numpy Docstring Validation for pandas.Series.str methods #59474

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

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
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
11 changes: 0 additions & 11 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,26 +158,15 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Series.sparse.sp_values SA01" \
-i "pandas.Series.sparse.to_coo PR07,RT03,SA01" \
-i "pandas.Series.std PR01,RT03,SA01" \
-i "pandas.Series.str.capitalize RT03" \
-i "pandas.Series.str.casefold RT03" \
-i "pandas.Series.str.center RT03,SA01" \
-i "pandas.Series.str.decode PR07,RT03,SA01" \
-i "pandas.Series.str.encode PR07,RT03,SA01" \
-i "pandas.Series.str.ljust RT03,SA01" \
-i "pandas.Series.str.lower RT03" \
-i "pandas.Series.str.lstrip RT03" \
-i "pandas.Series.str.match RT03" \
-i "pandas.Series.str.normalize RT03,SA01" \
-i "pandas.Series.str.partition RT03" \
-i "pandas.Series.str.repeat SA01" \
-i "pandas.Series.str.replace SA01" \
-i "pandas.Series.str.rjust RT03,SA01" \
-i "pandas.Series.str.rpartition RT03" \
-i "pandas.Series.str.rstrip RT03" \
-i "pandas.Series.str.strip RT03" \
-i "pandas.Series.str.swapcase RT03" \
-i "pandas.Series.str.title RT03" \
-i "pandas.Series.str.upper RT03" \
-i "pandas.Series.str.wrap RT03,SA01" \
-i "pandas.Series.str.zfill RT03" \
-i "pandas.Series.struct.dtypes SA01" \
Expand Down
31 changes: 30 additions & 1 deletion pandas/core/strings/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,18 @@ def pad(
Returns
-------
Series/Index of objects.
A Series or Index where the strings are modified by :meth:`str.%(method)s`.

See Also
--------
Series.str.rjust : Fills the left side of strings with an arbitrary
character.
Series.str.ljust : Fills the right side of strings with an arbitrary
character.
Series.str.center : Fills both sides of strings with an arbitrary
character.
Series.str.zfill : Pad strings in the Series/Index by prepending '0'
character.

Examples
--------
Expand Down Expand Up @@ -2024,11 +2036,19 @@ def decode(self, encoding, errors: str = "strict"):
Parameters
----------
encoding : str
Specifies the encoding to be used.
errors : str, optional
Specifies the error handling scheme.
Possible values are those supported by :meth:`bytes.decode`.

Returns
-------
Series or Index
A Series or Index with decoded strings.

See Also
--------
Series.str.encode : Encodes strings into bytes in a Series/Index.

Examples
--------
Expand Down Expand Up @@ -2063,11 +2083,19 @@ def encode(self, encoding, errors: str = "strict"):
Parameters
----------
encoding : str
Specifies the encoding to be used.
errors : str, optional
Specifies the error handling scheme.
Possible values are those supported by :meth:`str.encode`.

Returns
-------
Series/Index of objects
A Series or Index with strings encoded into bytes.

See Also
--------
Series.str.decode : Decodes bytes into strings in a Series/Index.

Examples
--------
Expand Down Expand Up @@ -3209,7 +3237,8 @@ def len(self):

Returns
-------
Series or Index of object
Series or Index of objects
A Series or Index where the strings are modified by :meth:`str.%(method)s`.

See Also
--------
Expand Down