Skip to content

Commit

Permalink
DOC: Fix Docstring Validation for pandas.Series.str.translate (#58699)
Browse files Browse the repository at this point in the history
* DOC: add RT03,SA01 for pandas.Series.str.translate

* DOC: remove RT03,SA01 for pandas.Series.str.translate
  • Loading branch information
tuhinsharma121 committed May 13, 2024
1 parent 63eee1b commit ed60fa6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 0 additions & 1 deletion ci/code_checks.sh
Expand Up @@ -228,7 +228,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Series.str.strip RT03" \
-i "pandas.Series.str.swapcase RT03" \
-i "pandas.Series.str.title RT03" \
-i "pandas.Series.str.translate RT03,SA01" \
-i "pandas.Series.str.upper RT03" \
-i "pandas.Series.str.wrap RT03,SA01" \
-i "pandas.Series.str.zfill RT03" \
Expand Down
14 changes: 13 additions & 1 deletion pandas/core/strings/accessor.py
Expand Up @@ -2408,7 +2408,11 @@ def translate(self, table):
"""
Map all characters in the string through the given mapping table.
Equivalent to standard :meth:`str.translate`.
This method is equivalent to the standard :meth:`str.translate`
method for strings. It maps each character in the string to a new
character according to the translation table provided. Unmapped
characters are left unchanged, while characters mapped to None
are removed.
Parameters
----------
Expand All @@ -2421,6 +2425,14 @@ def translate(self, table):
Returns
-------
Series or Index
A new Series or Index with translated strings.
See Also
--------
Series.str.replace : Replace occurrences of pattern/regex in the
Series with some other string.
Index.str.replace : Replace occurrences of pattern/regex in the
Index with some other string.
Examples
--------
Expand Down

0 comments on commit ed60fa6

Please sign in to comment.