Skip to content

Commit b57f570

Browse files
committed
docstring update: added more examples for pandas.Series.str.split() method
1 parent 52fe248 commit b57f570

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pandas/core/strings.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1116,9 +1116,8 @@ def str_split(arr, pat=None, n=None):
11161116
11171117
Returns
11181118
-------
1119-
split : Series/Index or DataFrame/MultiIndex of objects
1120-
Type matches caller unless ``expand=True`` (return type is DataFrame or
1121-
MultiIndex)
1119+
split : Series, Index, DataFrame or MultiIndex of objects
1120+
Type matches caller unless ``expand=True`` (see Notes)
11221121
11231122
Notes
11241123
-----
@@ -1129,6 +1128,9 @@ def str_split(arr, pat=None, n=None):
11291128
- If for a certain row the number of found splits < `n`,
11301129
append `None` for padding up to `n` if ``expand=True``
11311130
1131+
If using ``expand=True``, Series and Index callers return DataFrame and
1132+
MultIndex objects, respectively.
1133+
11321134
Examples
11331135
--------
11341136
>>> s = pd.Series(["this is good text", "but this is even better"])

0 commit comments

Comments
 (0)