Skip to content

Commit 4bb463e

Browse files
author
Montana Low
committed
move to separate test
1 parent 4c088c3 commit 4bb463e

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

pandas/tests/test_strings.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,19 +1943,6 @@ def test_split(self):
19431943
[u('f'), u('g'), u('h')]])
19441944
tm.assert_series_equal(result, exp)
19451945

1946-
# expand blank split GH 20067
1947-
values = Series([''])
1948-
result = values.str.split(expand=True)
1949-
exp = DataFrame([[]])
1950-
tm.assert_frame_equal(result, exp)
1951-
1952-
values = Series(['a b c', 'a b', '', ' '])
1953-
result = values.str.split(expand=True)
1954-
exp = DataFrame([['a', 'b', 'c'], ['a', 'b', np.nan],
1955-
[np.nan, np.nan, np.nan], [np.nan, np.nan, np.nan]])
1956-
tm.assert_frame_equal(result, exp)
1957-
1958-
19591946
def test_rsplit(self):
19601947
values = Series(['a_b_c', 'c_d_e', NA, 'f_g_h'])
19611948
result = values.str.rsplit('_')
@@ -2005,6 +1992,19 @@ def test_rsplit(self):
20051992
exp = Series([['a_b', 'c'], ['c_d', 'e'], NA, ['f_g', 'h']])
20061993
tm.assert_series_equal(result, exp)
20071994

1995+
def test_split_blank_string(self):
1996+
# expand blank split GH 20067
1997+
values = Series([''])
1998+
result = values.str.split(expand=True)
1999+
exp = DataFrame([[]])
2000+
tm.assert_frame_equal(result, exp)
2001+
2002+
values = Series(['a b c', 'a b', '', ' '])
2003+
result = values.str.split(expand=True)
2004+
exp = DataFrame([['a', 'b', 'c'], ['a', 'b', np.nan],
2005+
[np.nan, np.nan, np.nan], [np.nan, np.nan, np.nan]])
2006+
tm.assert_frame_equal(result, exp)
2007+
20082008
def test_split_noargs(self):
20092009
# #1859
20102010
s = Series(['Wes McKinney', 'Travis Oliphant'])

0 commit comments

Comments
 (0)