identical

UnitsAwareDataArray.identical(other: Self) bool

Like equals, but also checks the array name and attributes, and attributes on all coordinates.

Parameters:

other (DataArray) – DataArray to compare to.

Returns:

equal – True if the two DataArrays are identical.

Return type:

bool

See also

DataArray.broadcast_equals, DataArray.equals

Examples

>>> a = xr.DataArray([1, 2, 3], dims="X", attrs=dict(units="m"), name="Width")
>>> b = xr.DataArray([1, 2, 3], dims="X", attrs=dict(units="m"), name="Width")
>>> c = xr.DataArray([1, 2, 3], dims="X", attrs=dict(units="ft"), name="Width")
>>> a
<xarray.DataArray 'Width' (X: 3)> Size: 24B
array([1, 2, 3])
Dimensions without coordinates: X
.. attribute:: units

m

>>> b
<xarray.DataArray 'Width' (X: 3)> Size: 24B
array([1, 2, 3])
Dimensions without coordinates: X
.. attribute:: units

m

>>> c
<xarray.DataArray 'Width' (X: 3)> Size: 24B
array([1, 2, 3])
Dimensions without coordinates: X
.. attribute:: units

ft

>>> a.equals(b)
True
>>> a.identical(b)
True
>>> a.equals(c)
True
>>> a.identical(c)
False