@@ -1906,45 +1906,6 @@ def test_split_no_pat_with_nonzero_n(self):
19061906
19071907 def test_split_to_dataframe (self ):
19081908 s = Series (['nosplit' , 'alsonosplit' ])
1909-
1910- with tm .assert_produces_warning (FutureWarning ):
1911- result = s .str .split ('_' , return_type = 'frame' )
1912-
1913- exp = DataFrame ({0 : Series (['nosplit' , 'alsonosplit' ])})
1914- tm .assert_frame_equal (result , exp )
1915-
1916- s = Series (['some_equal_splits' , 'with_no_nans' ])
1917- with tm .assert_produces_warning (FutureWarning ):
1918- result = s .str .split ('_' , return_type = 'frame' )
1919- exp = DataFrame ({0 : ['some' , 'with' ],
1920- 1 : ['equal' , 'no' ],
1921- 2 : ['splits' , 'nans' ]})
1922- tm .assert_frame_equal (result , exp )
1923-
1924- s = Series (['some_unequal_splits' , 'one_of_these_things_is_not' ])
1925- with tm .assert_produces_warning (FutureWarning ):
1926- result = s .str .split ('_' , return_type = 'frame' )
1927- exp = DataFrame ({0 : ['some' , 'one' ],
1928- 1 : ['unequal' , 'of' ],
1929- 2 : ['splits' , 'these' ],
1930- 3 : [NA , 'things' ],
1931- 4 : [NA , 'is' ],
1932- 5 : [NA , 'not' ]})
1933- tm .assert_frame_equal (result , exp )
1934-
1935- s = Series (['some_splits' , 'with_index' ], index = ['preserve' , 'me' ])
1936- with tm .assert_produces_warning (FutureWarning ):
1937- result = s .str .split ('_' , return_type = 'frame' )
1938- exp = DataFrame ({0 : ['some' , 'with' ], 1 : ['splits' , 'index' ]},
1939- index = ['preserve' , 'me' ])
1940- tm .assert_frame_equal (result , exp )
1941-
1942- with tm .assertRaisesRegexp (ValueError , "expand must be" ):
1943- with tm .assert_produces_warning (FutureWarning ):
1944- s .str .split ('_' , return_type = "some_invalid_type" )
1945-
1946- def test_split_to_dataframe_expand (self ):
1947- s = Series (['nosplit' , 'alsonosplit' ])
19481909 result = s .str .split ('_' , expand = True )
19491910 exp = DataFrame ({0 : Series (['nosplit' , 'alsonosplit' ])})
19501911 tm .assert_frame_equal (result , exp )
@@ -1973,8 +1934,7 @@ def test_split_to_dataframe_expand(self):
19731934 tm .assert_frame_equal (result , exp )
19741935
19751936 with tm .assertRaisesRegexp (ValueError , "expand must be" ):
1976- with tm .assert_produces_warning (FutureWarning ):
1977- s .str .split ('_' , return_type = "some_invalid_type" )
1937+ s .str .split ('_' , expand = "not_a_boolean" )
19781938
19791939 def test_split_to_multiindex_expand (self ):
19801940 idx = Index (['nosplit' , 'alsonosplit' ])
@@ -1999,8 +1959,7 @@ def test_split_to_multiindex_expand(self):
19991959 self .assertEqual (result .nlevels , 6 )
20001960
20011961 with tm .assertRaisesRegexp (ValueError , "expand must be" ):
2002- with tm .assert_produces_warning (FutureWarning ):
2003- idx .str .split ('_' , return_type = "some_invalid_type" )
1962+ idx .str .split ('_' , expand = "not_a_boolean" )
20041963
20051964 def test_rsplit_to_dataframe_expand (self ):
20061965 s = Series (['nosplit' , 'alsonosplit' ])
0 commit comments