-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
API extensionAdds new functions or objects to the API.Adds new functions or objects to the API.Needs DiscussionNeeds further discussion.Needs further discussion.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.
Milestone
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?
Metadata
Metadata
Assignees
Labels
API extensionAdds new functions or objects to the API.Adds new functions or objects to the API.Needs DiscussionNeeds further discussion.Needs further discussion.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.