[Feature Request] iteration equivalent numpy's nditer or ndenumerate
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
Hi folks, is there any simple way to iterate over all elements of an xarray together with its labels? What I am looking for is an equivalent to numpy's nditer or rather ndenumerate method:
https://docs.scipy.org/doc/numpy/reference/generated/numpy.nditer.html
https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndenumerate.html
Ideally, the iterator should return both the current data element and its coordinates, potentially in the form of an (ordered) dictionary. Is there any direct possibility to achieve this with the current functionality of the package?
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.
Research direction
Start by reviewing xarray's current iteration functionality alongside the referenced numpy nditer and ndenumerate documentation. Define the intended iterator interface and coordinate representation before identifying the relevant implementation and tests; done would mean iteration exposes each data element together with its labels.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100