(x, fn=None, skipna=True, numeric_only=False)
| 315 | |
| 316 | |
| 317 | def idxmaxmin_chunk(x, fn=None, skipna=True, numeric_only=False): |
| 318 | numeric_only_kwargs = {} if is_series_like(x) else {"numeric_only": numeric_only} |
| 319 | minmax = "max" if fn == "idxmax" else "min" |
| 320 | if len(x) > 0: |
| 321 | idx = getattr(x, fn)(skipna=skipna, **numeric_only_kwargs) |
| 322 | value = getattr(x, minmax)(skipna=skipna, **numeric_only_kwargs) |
| 323 | else: |
| 324 | idx = value = meta_series_constructor(x)([], dtype="i8") |
| 325 | if is_series_like(idx): |
| 326 | return meta_frame_constructor(x)({"idx": idx, "value": value}) |
| 327 | return meta_frame_constructor(x)({"idx": [idx], "value": [value]}) |
| 328 | |
| 329 | |
| 330 | def idxmaxmin_row(x, fn=None, skipna=True): |
nothing calls this directly
no test coverage detected
searching dependent graphs…