Skip to content

DataArray constructor allow iterables #482

@clarkfitzg

Description

@clarkfitzg

The DataArray currently requires a sequence for the coords and dims. This could be generalized to allow passing iterables. Currently this raises a ValueError:

b = xray.DataArray(np.random.randn(3, 4), dims=(x for x in ('a', 'b')))

If iterables were allowed it would work. This comes up more often in Python 3. Some conversation in #466

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions