Skip to content

Commit

Permalink
DOCS: fix docstring validation errors for pandas.Series (#59596)
Browse files Browse the repository at this point in the history
Fixes:
-i "pandas.Series.str.match RT03" \
-i "pandas.Series.str.normalize RT03,SA01" \
-i "pandas.Series.str.repeat SA01" \
-i "pandas.Series.str.replace SA01" \
  • Loading branch information
ivonastojanovic authored Aug 25, 2024
1 parent 2130a99 commit fe42b3b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
4 changes: 0 additions & 4 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ 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.match RT03" \
-i "pandas.Series.str.normalize RT03,SA01" \
-i "pandas.Series.str.repeat SA01" \
-i "pandas.Series.str.replace SA01" \
-i "pandas.Series.str.wrap RT03,SA01" \
-i "pandas.Series.str.zfill RT03" \
-i "pandas.Series.struct.dtypes SA01" \
Expand Down
38 changes: 38 additions & 0 deletions pandas/core/strings/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,9 @@ def match(self, pat: str, case: bool = True, flags: int = 0, na=None):
Returns
-------
Series/Index/array of boolean values
A Series, Index, or array of boolean values indicating whether the start
of each string matches the pattern. The result will be of the same type
as the input.
See Also
--------
Expand Down Expand Up @@ -1503,6 +1506,14 @@ def replace(
* if `pat` is a compiled regex and `case` or `flags` is set
* if `pat` is a dictionary and `repl` is not None.
See Also
--------
Series.str.replace : Method to replace occurrences of a substring with another
substring.
Series.str.extract : Extract substrings using a regular expression.
Series.str.findall : Find all occurrences of a pattern or regex in each string.
Series.str.split : Split each string by a specified delimiter or pattern.
Notes
-----
When `pat` is a compiled regex, all flags should be included in the
Expand Down Expand Up @@ -1634,6 +1645,20 @@ def repeat(self, repeats):
Series or Index of repeated string objects specified by
input parameter repeats.
See Also
--------
Series.str.lower : Convert all characters in each string to lowercase.
Series.str.upper : Convert all characters in each string to uppercase.
Series.str.title : Convert each string to title case (capitalizing the first
letter of each word).
Series.str.strip : Remove leading and trailing whitespace from each string.
Series.str.replace : Replace occurrences of a substring with another substring
in each string.
Series.str.ljust : Left-justify each string in the Series/Index by padding with
a specified character.
Series.str.rjust : Right-justify each string in the Series/Index by padding with
a specified character.
Examples
--------
>>> s = pd.Series(["a", "b", "c"])
Expand Down Expand Up @@ -3091,6 +3116,19 @@ def normalize(self, form):
Returns
-------
Series/Index of objects
A Series or Index of strings in the same Unicode form specified by `form`.
The returned object retains the same type as the input (Series or Index),
and contains the normalized strings.
See Also
--------
Series.str.upper : Convert all characters in each string to uppercase.
Series.str.lower : Convert all characters in each string to lowercase.
Series.str.title : Convert each string to title case (capitalizing the
first letter of each word).
Series.str.strip : Remove leading and trailing whitespace from each string.
Series.str.replace : Replace occurrences of a substring with another substring
in each string.
Examples
--------
Expand Down

0 comments on commit fe42b3b

Please sign in to comment.