You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, nanarg{min,max}(..., axis=...) raises a ValueError when any full-nan slice exists. On numpy's side it looks like a while ago (#3030) this used to return UINTPTR_MIN (the largest negative value), and that behavior was removed to avoid hiding bugs.
I agree with raising by default, but OTOH this prevents writing code where we know that all-nan slices are possible and we are ready to handle them. Adding an option like raise_on_all_nan: bool (defaulting to True) would allow one to do e.g.
idxs = np.nanargmin(t, axis=1, raise_on_all_nan=False)
all_nans_mask = idxs < 0
# do some handling with all_nans_mask
Currently, nanarg{min,max}(..., axis=...) raises a ValueError when any full-nan slice exists. On numpy's side it looks like a while ago (#3030) this used to return UINTPTR_MIN (the largest negative value), and that behavior was removed to avoid hiding bugs.
I agree with raising by default, but OTOH this prevents writing code where we know that all-nan slices are possible and we are ready to handle them. Adding an option like
raise_on_all_nan: bool
(defaulting to True) would allow one to do e.g.Similar issue posted on numpy's side as numpy/numpy#12352.
The text was updated successfully, but these errors were encountered: