RFC: add support for `nan*` reductions
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with the Array API min() specification linked in the issue and compare the stated nanmin examples across NumPy and Torch. Clarify the desired cross-backend behavior and whether this should become a specification change or guidance; done requires an agreed approach, documented semantics, and any corresponding standard updates.
Written by the indexing model from the issue text.
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?
- Dominant language
- Python
- Stars
- 281
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from data-apis/array-api
-
bug Maintenance Narrative Content
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Maintenance
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in data-apis/array-api
Similar issues
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-webui/open-webui#30750 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 90/100