@@ -1144,18 +1144,7 @@ def test_timedelta64_analytics(self):
11441144 expected = Timedelta ("1 days" )
11451145 assert result == expected
11461146
1147- @pytest .mark .parametrize (
1148- "test_input,error_type" ,
1149- [
1150- (Series ([], dtype = "float64" ), ValueError ),
1151- # For strings, or any Series with dtype 'O'
1152- (Series (["foo" , "bar" , "baz" ]), TypeError ),
1153- (Series ([(1 ,), (2 ,)]), TypeError ),
1154- # For mixed data types
1155- (Series (["foo" , "foo" , "bar" , "bar" , None , np .nan , "baz" ]), TypeError ),
1156- ],
1157- )
1158- def test_assert_idxminmax_empty_raises (self , test_input , error_type ):
1147+ def test_assert_idxminmax_empty_raises (self ):
11591148 """
11601149 Cases where ``Series.argmax`` and related should raise an exception
11611150 """
@@ -1294,13 +1283,14 @@ def test_minmax_nat_series(self, nat_ser):
12941283 @pytest .mark .parametrize (
12951284 "nat_df" ,
12961285 [
1297- DataFrame ( [NaT , NaT ]) ,
1298- DataFrame ( [NaT , Timedelta ("nat" )]) ,
1299- DataFrame ( [Timedelta ("nat" ), Timedelta ("nat" )]) ,
1286+ [NaT , NaT ],
1287+ [NaT , Timedelta ("nat" )],
1288+ [Timedelta ("nat" ), Timedelta ("nat" )],
13001289 ],
13011290 )
13021291 def test_minmax_nat_dataframe (self , nat_df ):
13031292 # GH#23282
1293+ nat_df = DataFrame (nat_df )
13041294 assert nat_df .min ()[0 ] is NaT
13051295 assert nat_df .max ()[0 ] is NaT
13061296 assert nat_df .min (skipna = False )[0 ] is NaT
@@ -1399,14 +1389,10 @@ class TestSeriesMode:
13991389 # were moved from a series-specific test file, _not_ that these tests are
14001390 # intended long-term to be series-specific
14011391
1402- @pytest .mark .parametrize (
1403- "dropna, expected" ,
1404- [(True , Series ([], dtype = np .float64 )), (False , Series ([], dtype = np .float64 ))],
1405- )
1406- def test_mode_empty (self , dropna , expected ):
1392+ def test_mode_empty (self , dropna ):
14071393 s = Series ([], dtype = np .float64 )
14081394 result = s .mode (dropna )
1409- tm .assert_series_equal (result , expected )
1395+ tm .assert_series_equal (result , s )
14101396
14111397 @pytest .mark .parametrize (
14121398 "dropna, data, expected" ,
@@ -1619,23 +1605,24 @@ def test_mode_boolean_with_na(self):
16191605 [
16201606 (
16211607 [0 , 1j , 1 , 1 , 1 + 1j , 1 + 2j ],
1622- Series ( [1 ], dtype = np . complex128 ) ,
1608+ [1 ],
16231609 np .complex128 ,
16241610 ),
16251611 (
16261612 [0 , 1j , 1 , 1 , 1 + 1j , 1 + 2j ],
1627- Series ( [1 ], dtype = np . complex64 ) ,
1613+ [1 ],
16281614 np .complex64 ,
16291615 ),
16301616 (
16311617 [1 + 1j , 2j , 1 + 1j ],
1632- Series ( [1 + 1j ], dtype = np . complex128 ) ,
1618+ [1 + 1j ],
16331619 np .complex128 ,
16341620 ),
16351621 ],
16361622 )
16371623 def test_single_mode_value_complex (self , array , expected , dtype ):
16381624 result = Series (array , dtype = dtype ).mode ()
1625+ expected = Series (expected , dtype = dtype )
16391626 tm .assert_series_equal (result , expected )
16401627
16411628 @pytest .mark .parametrize (
@@ -1644,12 +1631,12 @@ def test_single_mode_value_complex(self, array, expected, dtype):
16441631 (
16451632 # no modes
16461633 [0 , 1j , 1 , 1 + 1j , 1 + 2j ],
1647- Series ( [0j , 1j , 1 + 0j , 1 + 1j , 1 + 2j ], dtype = np . complex128 ) ,
1634+ [0j , 1j , 1 + 0j , 1 + 1j , 1 + 2j ],
16481635 np .complex128 ,
16491636 ),
16501637 (
16511638 [1 + 1j , 2j , 1 + 1j , 2j , 3 ],
1652- Series ( [2j , 1 + 1j ], dtype = np . complex64 ) ,
1639+ [2j , 1 + 1j ],
16531640 np .complex64 ,
16541641 ),
16551642 ],
@@ -1659,4 +1646,5 @@ def test_multimode_complex(self, array, expected, dtype):
16591646 # mode tries to sort multimodal series.
16601647 # Complex numbers are sorted by their magnitude
16611648 result = Series (array , dtype = dtype ).mode ()
1649+ expected = Series (expected , dtype = dtype )
16621650 tm .assert_series_equal (result , expected )
0 commit comments