Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pandas/core/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,9 @@ def str_split(arr, pat=None, n=None, return_type='series'):
if return_type in ('frame', 'expand') and isinstance(arr, Index):
raise ValueError("return_type='frame' is not supported for string "
"methods on Index")
if return_type in ('series', 'index', 'frame'):
warnings.warn(("'series', 'index' and 'frame' are deprecated. Please use 'same' or 'expand' instead"),
FutureWarning)
if pat is None:
if n is None or n == 0:
n = -1
Expand Down
1 change: 0 additions & 1 deletion pandas/tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,6 @@ def test_str_attribute(self):
idx.str.split(return_type='frame')
with self.assertRaisesRegexp(ValueError, 'not supported'):
idx.str.split(return_type='expand')

# test boolean case, should return np.array instead of boolean Index
idx = Index(['a1', 'a2', 'b1', 'b2'])
expected = np.array([True, True, False, False])
Expand Down