@@ -1714,36 +1714,3 @@ def test_groupby_multiindex_nat():
1714
1714
result = ser .groupby (level = 1 ).mean ()
1715
1715
expected = pd .Series ([3. , 2.5 ], index = ["a" , "b" ])
1716
1716
assert_series_equal (result , expected )
1717
-
1718
-
1719
- def test_idxmin_idxmax_returns_int_types ():
1720
- # GH 25444
1721
- df = pd .DataFrame ({'name' : ['A' , 'A' , 'B' , 'B' ],
1722
- 'c_int' : [1 , 2 , 3 , 4 ],
1723
- 'c_float' : [4.02 , 3.03 , 2.04 , 1.05 ],
1724
- 'c_date' : ['2019' , '2018' , '2016' , '2017' ]})
1725
- df ['c_date' ] = pd .to_datetime (df ['c_date' ])
1726
-
1727
- idxmins_computed = df .groupby ('name' ).idxmin ()
1728
- idxmaxs_computed = df .groupby ('name' ).idxmax ()
1729
-
1730
- for col in idxmaxs_computed :
1731
- assert idxmins_computed [col ].dtype == np .int64
1732
- assert idxmaxs_computed [col ].dtype == np .int64
1733
-
1734
- idxmins_expected = pd .DataFrame ({'c_int' : [0 , 2 ],
1735
- 'c_float' : [1 , 3 ],
1736
- 'c_date' : [1 , 2 ]},
1737
- index = ['A' , 'B' ])
1738
-
1739
- idxmins_expected .index .name = "name"
1740
-
1741
- idxmaxs_expected = pd .DataFrame ({'c_int' : [1 , 3 ],
1742
- 'c_float' : [0 , 2 ],
1743
- 'c_date' : [0 , 3 ]},
1744
- index = ['A' , 'B' ])
1745
-
1746
- idxmaxs_expected .index .name = "name"
1747
-
1748
- assert_frame_equal (idxmins_expected , idxmins_computed )
1749
- assert_frame_equal (idxmaxs_expected , idxmaxs_computed )
0 commit comments