MCPcopy
hub / github.com/pydata/xarray / _nan_minmax_object

Function _nan_minmax_object

xarray/computation/nanops.py:56–66  ·  view source on GitHub ↗

In house nanmin and nanmax for object array

(func, fill_value, value, axis=None, **kwargs)

Source from the content-addressed store, hash-verified

54
55
56def _nan_minmax_object(func, fill_value, value, axis=None, **kwargs):
57 """In house nanmin and nanmax for object array"""
58 valid_count = count(value, axis=axis)
59 filled_value = fillna(value, fill_value)
60 data = getattr(np, func)(filled_value, axis=axis, **kwargs)
61 if not hasattr(data, "dtype"): # scalar case
62 data = fill_value if valid_count == 0 else data
63 # we've computed a single min, max value of type object.
64 # don't let np.array turn a tuple back into an array
65 return utils.to_0d_object_array(data)
66 return where_method(data, valid_count != 0)
67
68
69def nanmin(a, axis=None, out=None):

Callers 2

nanminFunction · 0.85
nanmaxFunction · 0.85

Calls 3

countFunction · 0.90
fillnaFunction · 0.90
where_methodFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…