File tree 2 files changed +7
-13
lines changed
2 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -11010,7 +11010,8 @@ def idxmin(
11010
11010
11011
11011
index = data ._get_axis (axis )
11012
11012
result = [index [i ] if i >= 0 else np .nan for i in indices ]
11013
- return data ._constructor_sliced (result , index = data ._get_agg_axis (axis ))
11013
+ final_result = data ._constructor_sliced (result , index = data ._get_agg_axis (axis ))
11014
+ return final_result .__finalize__ (self , method = "idxmin" )
11014
11015
11015
11016
@doc (_shared_docs ["idxmax" ], numeric_only_default = "False" )
11016
11017
def idxmax (
@@ -11035,7 +11036,8 @@ def idxmax(
11035
11036
11036
11037
index = data ._get_axis (axis )
11037
11038
result = [index [i ] if i >= 0 else np .nan for i in indices ]
11038
- return data ._constructor_sliced (result , index = data ._get_agg_axis (axis ))
11039
+ final_result = data ._constructor_sliced (result , index = data ._get_agg_axis (axis ))
11040
+ return final_result .__finalize__ (self , method = "idxmax" )
11039
11041
11040
11042
def _get_agg_axis (self , axis_num : int ) -> Index :
11041
11043
"""
Original file line number Diff line number Diff line change 226
226
pytest .param (
227
227
(pd .DataFrame , frame_data , operator .methodcaller ("nunique" )),
228
228
),
229
- pytest .param (
230
- (pd .DataFrame , frame_data , operator .methodcaller ("idxmin" )),
231
- marks = not_implemented_mark ,
232
- ),
233
- pytest .param (
234
- (pd .DataFrame , frame_data , operator .methodcaller ("idxmax" )),
235
- marks = not_implemented_mark ,
236
- ),
237
- pytest .param (
238
- (pd .DataFrame , frame_data , operator .methodcaller ("mode" )),
239
- ),
229
+ (pd .DataFrame , frame_data , operator .methodcaller ("idxmin" )),
230
+ (pd .DataFrame , frame_data , operator .methodcaller ("idxmax" )),
231
+ (pd .DataFrame , frame_data , operator .methodcaller ("mode" )),
240
232
pytest .param (
241
233
(pd .Series , [0 ], operator .methodcaller ("mode" )),
242
234
marks = not_implemented_mark ,
You can’t perform that action at this time.
0 commit comments