Skip to content

Commit 522ca66

Browse files
committed
DOC: Created reusable docstring for split and rsplit
1 parent 2a1ea74 commit 522ca66

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pandas/core/strings.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,17 +1349,17 @@ def str_split(arr, pat=None, n=None):
13491349
Parameters
13501350
----------
13511351
pat : str, optional
1352-
String or regular expression to split on; If not specified,
1352+
String or regular expression to split on; If not specified,
13531353
split on whitespace.
13541354
n : int, default -1 (all)
1355-
Limit number of splits in output; ``None``, 0 and -1 will
1355+
Limit number of splits in output; ``None``, 0 and -1 will
13561356
be interpreted as return all splits.
13571357
expand : bool, default False
13581358
Expand the splitted strings into separate columns.
13591359
13601360
Returns
13611361
-------
1362-
Series, Index, DataFrame or MultiIndex
1362+
Series, Index, DataFrame or MultiIndex
13631363
"""
13641364
if pat is None:
13651365
if n is None or n == 0:
@@ -1381,7 +1381,7 @@ def str_split(arr, pat=None, n=None):
13811381

13821382
def str_rsplit(arr, pat=None, n=None):
13831383
"""
1384-
Split strings around given separator/delimiter (starting from
1384+
Split strings around given separator/delimiter (starting from
13851385
the right).
13861386
13871387
Parameters
@@ -2243,8 +2243,8 @@ def cat(self, others=None, sep=None, na_rep=None, join=None):
22432243
_shared_docs['str_split'] = ("""
22442244
Split strings around given separator/delimiter.
22452245
2246-
Returns a list of the words from each string in Series/Index,
2247-
split by the given delimiter string, starting at the %(side)s of the
2246+
Returns a list of the words from each string in Series/Index,
2247+
split by the given delimiter string, starting at the %(side)s of the
22482248
string. Equivalent to :meth:`str.%(method)s`.
22492249
22502250
Parameters
@@ -2309,8 +2309,8 @@ def cat(self, others=None, sep=None, na_rep=None, join=None):
23092309
1 [but this is even better]
23102310
dtype: object
23112311
2312-
When using ``expand=True``, the split and rsplit elements will expand out into
2313-
separate columns.
2312+
When using ``expand=True``, the split and rsplit elements will
2313+
expand out into separate columns.
23142314
23152315
For Series object, output return type is DataFrame.
23162316

0 commit comments

Comments
 (0)