(x, fn=None, skipna=True)
| 328 | |
| 329 | |
| 330 | def idxmaxmin_row(x, fn=None, skipna=True): |
| 331 | minmax = "max" if fn == "idxmax" else "min" |
| 332 | if len(x) > 0: |
| 333 | x = x.set_index("idx") |
| 334 | # potentially coerced to object, so cast back |
| 335 | value = x.value.infer_objects() |
| 336 | idx = [getattr(value, fn)(skipna=skipna)] |
| 337 | value = [getattr(value, minmax)(skipna=skipna)] |
| 338 | else: |
| 339 | idx = value = meta_series_constructor(x)([], dtype="i8") |
| 340 | return meta_frame_constructor(x)( |
| 341 | { |
| 342 | "idx": meta_series_constructor(x)(idx, dtype=x.index.dtype), |
| 343 | "value": meta_series_constructor(x)(value, dtype=x.dtypes.iloc[0]), |
| 344 | } |
| 345 | ) |
| 346 | |
| 347 | |
| 348 | def idxmaxmin_combine(x, fn=None, skipna=True): |
nothing calls this directly
no test coverage detected
searching dependent graphs…