MCPcopy Create free account
hub / github.com/dask/dask / idxmaxmin_chunk

Function idxmaxmin_chunk

dask/dataframe/core.py:316–326  ·  view source on GitHub ↗
(x, fn=None, skipna=True, numeric_only=False)

Source from the content-addressed store, hash-verified

314
315
316def idxmaxmin_chunk(x, fn=None, skipna=True, numeric_only=False):
317 numeric_only_kwargs = {} if is_series_like(x) else {"numeric_only": numeric_only}
318 minmax = "max" if fn == "idxmax" else "min"
319 if len(x) > 0:
320 idx = getattr(x, fn)(skipna=skipna, **numeric_only_kwargs)
321 value = getattr(x, minmax)(skipna=skipna, **numeric_only_kwargs)
322 else:
323 idx = value = meta_series_constructor(x)([], dtype="i8")
324 if is_series_like(idx):
325 return meta_frame_constructor(x)({"idx": idx, "value": value})
326 return meta_frame_constructor(x)({"idx": [idx], "value": [value]})
327
328
329def idxmaxmin_row(x, fn=None, skipna=True):

Callers

nothing calls this directly

Calls 3

is_series_likeFunction · 0.90
meta_series_constructorFunction · 0.90
meta_frame_constructorFunction · 0.90

Tested by

no test coverage detected