Skip to content

Commit 32d0ae9

Browse files
DOC: Enforce Numpy Docstring Validation for pandas.Series.str methods (#59474)
* Doctrings for pandas.Series.str functions pandas.Series.str.capitalize pandas.Series.str.casefold pandas.Series.str.center pandas.Series.str.decode pandas.Series.str.encode * Fixed other docstrings along the way
1 parent a3f2d48 commit 32d0ae9

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

ci/code_checks.sh

-11
Original file line numberDiff line numberDiff line change
@@ -158,26 +158,15 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
158158
-i "pandas.Series.sparse.sp_values SA01" \
159159
-i "pandas.Series.sparse.to_coo PR07,RT03,SA01" \
160160
-i "pandas.Series.std PR01,RT03,SA01" \
161-
-i "pandas.Series.str.capitalize RT03" \
162-
-i "pandas.Series.str.casefold RT03" \
163-
-i "pandas.Series.str.center RT03,SA01" \
164-
-i "pandas.Series.str.decode PR07,RT03,SA01" \
165-
-i "pandas.Series.str.encode PR07,RT03,SA01" \
166-
-i "pandas.Series.str.ljust RT03,SA01" \
167-
-i "pandas.Series.str.lower RT03" \
168161
-i "pandas.Series.str.lstrip RT03" \
169162
-i "pandas.Series.str.match RT03" \
170163
-i "pandas.Series.str.normalize RT03,SA01" \
171164
-i "pandas.Series.str.partition RT03" \
172165
-i "pandas.Series.str.repeat SA01" \
173166
-i "pandas.Series.str.replace SA01" \
174-
-i "pandas.Series.str.rjust RT03,SA01" \
175167
-i "pandas.Series.str.rpartition RT03" \
176168
-i "pandas.Series.str.rstrip RT03" \
177169
-i "pandas.Series.str.strip RT03" \
178-
-i "pandas.Series.str.swapcase RT03" \
179-
-i "pandas.Series.str.title RT03" \
180-
-i "pandas.Series.str.upper RT03" \
181170
-i "pandas.Series.str.wrap RT03,SA01" \
182171
-i "pandas.Series.str.zfill RT03" \
183172
-i "pandas.Series.struct.dtypes SA01" \

pandas/core/strings/accessor.py

+30-1
Original file line numberDiff line numberDiff line change
@@ -1749,6 +1749,18 @@ def pad(
17491749
Returns
17501750
-------
17511751
Series/Index of objects.
1752+
A Series or Index where the strings are modified by :meth:`str.%(method)s`.
1753+
1754+
See Also
1755+
--------
1756+
Series.str.rjust : Fills the left side of strings with an arbitrary
1757+
character.
1758+
Series.str.ljust : Fills the right side of strings with an arbitrary
1759+
character.
1760+
Series.str.center : Fills both sides of strings with an arbitrary
1761+
character.
1762+
Series.str.zfill : Pad strings in the Series/Index by prepending '0'
1763+
character.
17521764
17531765
Examples
17541766
--------
@@ -2024,11 +2036,19 @@ def decode(self, encoding, errors: str = "strict"):
20242036
Parameters
20252037
----------
20262038
encoding : str
2039+
Specifies the encoding to be used.
20272040
errors : str, optional
2041+
Specifies the error handling scheme.
2042+
Possible values are those supported by :meth:`bytes.decode`.
20282043
20292044
Returns
20302045
-------
20312046
Series or Index
2047+
A Series or Index with decoded strings.
2048+
2049+
See Also
2050+
--------
2051+
Series.str.encode : Encodes strings into bytes in a Series/Index.
20322052
20332053
Examples
20342054
--------
@@ -2063,11 +2083,19 @@ def encode(self, encoding, errors: str = "strict"):
20632083
Parameters
20642084
----------
20652085
encoding : str
2086+
Specifies the encoding to be used.
20662087
errors : str, optional
2088+
Specifies the error handling scheme.
2089+
Possible values are those supported by :meth:`str.encode`.
20672090
20682091
Returns
20692092
-------
20702093
Series/Index of objects
2094+
A Series or Index with strings encoded into bytes.
2095+
2096+
See Also
2097+
--------
2098+
Series.str.decode : Decodes bytes into strings in a Series/Index.
20712099
20722100
Examples
20732101
--------
@@ -3209,7 +3237,8 @@ def len(self):
32093237
32103238
Returns
32113239
-------
3212-
Series or Index of object
3240+
Series or Index of objects
3241+
A Series or Index where the strings are modified by :meth:`str.%(method)s`.
32133242
32143243
See Also
32153244
--------

0 commit comments

Comments
 (0)