Open
Description
Is there advice around handling NaNs and how to translate Numpy code to using the Array API?
In particular I have code like np.nanmin(X, axis=0)
that I would like to rewrite so that it works with Numpy, Torch, etc arrays.
To me the "obvious" translation seems to be xp.min(X[~xp.isnan(X)], axis=0)
but this doesn't work if X
has a shape like (7500, 4)
(here xp
is the namespace of the array X
). Another option I looked for is a where=
argument to min()
, but that doesn't exist unfortunately.
Does anyone have advice on this topic or knows if there is work planned on this?