8000 __contains__ does not work with DataArray · Issue #2062 · pydata/xarray · GitHub
[go: up one dir, main page]

Skip to content
__contains__ does not work with DataArray #2062
@fujiisoup

Description

@fujiisoup

Code Sample, a copy-pastable example if possible

>>> da = xr.DataArray([0, 1, 2], dims='x')
>>> 0 in da
( warning omitted )
False
>>> 0 in da.values
True

Problem description

__contains__ should work as np.ndarray does.

Expected Output

>>> 0 in da
True

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

      0