Skip to content

Commit ed60fa6

Browse files
DOC: Fix Docstring Validation for pandas.Series.str.translate (#58699)
* DOC: add RT03,SA01 for pandas.Series.str.translate * DOC: remove RT03,SA01 for pandas.Series.str.translate
1 parent 63eee1b commit ed60fa6

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
228228
-i "pandas.Series.str.strip RT03" \
229229
-i "pandas.Series.str.swapcase RT03" \
230230
-i "pandas.Series.str.title RT03" \
231-
-i "pandas.Series.str.translate RT03,SA01" \
232231
-i "pandas.Series.str.upper RT03" \
233232
-i "pandas.Series.str.wrap RT03,SA01" \
234233
-i "pandas.Series.str.zfill RT03" \

pandas/core/strings/accessor.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -2408,7 +2408,11 @@ def translate(self, table):
24082408
"""
24092409
Map all characters in the string through the given mapping table.
24102410
2411-
Equivalent to standard :meth:`str.translate`.
2411+
This method is equivalent to the standard :meth:`str.translate`
2412+
method for strings. It maps each character in the string to a new
2413+
character according to the translation table provided. Unmapped
2414+
characters are left unchanged, while characters mapped to None
2415+
are removed.
24122416
24132417
Parameters
24142418
----------
@@ -2421,6 +2425,14 @@ def translate(self, table):
24212425
Returns
24222426
-------
24232427
Series or Index
2428+
A new Series or Index with translated strings.
2429+
2430+
See Also
2431+
--------
2432+
Series.str.replace : Replace occurrences of pattern/regex in the
2433+
Series with some other string.
2434+
Index.str.replace : Replace occurrences of pattern/regex in the
2435+
Index with some other string.
24242436
24252437
Examples
24262438
--------

0 commit comments

Comments
 (0)