Skip to content

Commit 2f93c6d

Browse files
moaraccountsLesley
authored andcommitted
DOC:GH34026 (#34059)
* DOC:GH34026 * DOC:Fixing desc. for Series.str.rstrip() and Series.str.lstrip() (#34026) * DOC:Removed text strings from lstrip and rstrip. Added a new %position item to each dict. (pandas-dev34026) * DOC:Fixed strip so %position now reads leading and trailing. Built documentation locally to confirm changes (pandas-dev34026) Co-authored-by: Lesley <[email protected]>
1 parent 965d99a commit 2f93c6d

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

pandas/core/strings.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -2975,7 +2975,7 @@ def encode(self, encoding, errors="strict"):
29752975
_shared_docs[
29762976
"str_strip"
29772977
] = r"""
2978-
Remove leading and trailing characters.
2978+
Remove %(position)s characters.
29792979
29802980
Strip whitespaces (including newlines) or a set of specified characters
29812981
from each string in the Series/Index from %(side)s.
@@ -3038,20 +3038,29 @@ def encode(self, encoding, errors="strict"):
30383038
"""
30393039

30403040
@Appender(
3041-
_shared_docs["str_strip"] % dict(side="left and right sides", method="strip")
3041+
_shared_docs["str_strip"]
3042+
% dict(
3043+
side="left and right sides", method="strip", position="leading and trailing"
3044+
)
30423045
)
30433046
@forbid_nonstring_types(["bytes"])
30443047
def strip(self, to_strip=None):
30453048
result = str_strip(self._parent, to_strip, side="both")
30463049
return self._wrap_result(result)
30473050

3048-
@Appender(_shared_docs["str_strip"] % dict(side="left side", method="lstrip"))
3051+
@Appender(
3052+
_shared_docs["str_strip"]
3053+
% dict(side="left side", method="lstrip", position="leading")
3054+
)
30493055
@forbid_nonstring_types(["bytes"])
30503056
def lstrip(self, to_strip=None):
30513057
result = str_strip(self._parent, to_strip, side="left")
30523058
return self._wrap_result(result)
30533059

3054-
@Appender(_shared_docs["str_strip"] % dict(side="right side", method="rstrip"))
3060+
@Appender(
3061+
_shared_docs["str_strip"]
3062+
% dict(side="right side", method="rstrip", position="trailing")
3063+
)
30553064
@forbid_nonstring_types(["bytes"])
30563065
def rstrip(self, to_strip=None):
30573066
result = str_strip(self._parent, to_strip, side="right")

0 commit comments

Comments
 (0)