MCPcopy
hub / github.com/pandas-dev/pandas / _nanminmax

Function _nanminmax

pandas/core/nanops.py:1098–1121  ·  view source on GitHub ↗
(meth, fill_value_typ)

Source from the content-addressed store, hash-verified

1096
1097
1098def _nanminmax(meth, fill_value_typ):
1099 @bottleneck_switch(name=f"nan{meth}")
1100 @_datetimelike_compat
1101 def reduction(
1102 values: np.ndarray,
1103 *,
1104 axis: AxisInt | None = None,
1105 skipna: bool = True,
1106 mask: npt.NDArray[np.bool_] | None = None,
1107 ):
1108 if values.size == 0:
1109 return _na_for_min_count(values, axis)
1110
1111 dtype = values.dtype
1112 values, mask = _get_values(
1113 values, skipna, fill_value_typ=fill_value_typ, mask=mask
1114 )
1115 result = getattr(values, meth)(axis)
1116 result = _maybe_null_out(
1117 result, axis, mask, values.shape, datetimelike=dtype.kind in "mM"
1118 )
1119 return result
1120
1121 return reduction
1122
1123
1124nanmin = _nanminmax("min", fill_value_typ="+inf")

Callers 1

nanops.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected