@@ -1118,7 +1118,7 @@ def str_split(arr, pat=None, n=None):
11181118 -------
11191119 split : Series/Index or DataFrame/MultiIndex of objects
11201120 Type matches caller unless ``expand=True`` (return type is DataFrame or
1121- MultiIndex)
1121+ MultiIndex)
11221122
11231123 Notes
11241124 -----
@@ -1145,8 +1145,10 @@ def str_split(arr, pat=None, n=None):
11451145 1 [but this is even better]
11461146 dtype: object
11471147
1148- When using ``expand=True``, the split elements will
1149- expand out into separate columns.
1148+ When using ``expand=True``, the split elements will expand out into
1149+ separate columns.
1150+
1151+ For Series object, output return type is DataFrame.
11501152
11511153 >>> s.str.split(expand=True)
11521154 0 1 2 3 4
@@ -1157,6 +1159,13 @@ def str_split(arr, pat=None, n=None):
11571159 0 this good text
11581160 1 but this even better
11591161
1162+ For Index object, output return type is MultiIndex.
1163+
1164+ >>> i = pd.Index(["ba 100 001", "ba 101 002", "ba 102 003"])
1165+ >>> i.str.split(expand=True)
1166+ MultiIndex(levels=[['ba'], ['100', '101', '102'], ['001', '002', '003']],
1167+ labels=[[0, 0, 0], [0, 1, 2], [0, 1, 2]])
1168+
11601169 Parameter `n` can be used to limit the number of splits in the output.
11611170
11621171 >>> s.str.split("is", n=1)
0 commit comments