diff --git a/pandas/core/strings.py b/pandas/core/strings.py index 604ee47c8fee7..aa73d09194248 100644 --- a/pandas/core/strings.py +++ b/pandas/core/strings.py @@ -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 diff --git a/pandas/tests/test_index.py b/pandas/tests/test_index.py index 7267924baf023..159635da5d505 100644 --- a/pandas/tests/test_index.py +++ b/pandas/tests/test_index.py @@ -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])