Skip to content

[Feature Request] iteration equivalent numpy's nditer or ndenumerate #2805

@AdrianSosic

Description

@AdrianSosic

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions