MCPcopy
hub / github.com/dask/dask / idxmaxmin_row

Function idxmaxmin_row

dask/dataframe/core.py:330–345  ·  view source on GitHub ↗
(x, fn=None, skipna=True)

Source from the content-addressed store, hash-verified

328
329
330def 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
348def idxmaxmin_combine(x, fn=None, skipna=True):

Callers

nothing calls this directly

Calls 3

meta_series_constructorFunction · 0.90
meta_frame_constructorFunction · 0.90
set_indexMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…