xarray.Dataset.identical#

Dataset.identical(other)[source]#

Like equals, but also checks all dataset attributes and the attributes on all variables and coordinates.

Example

```>>> a = xr.Dataset(
...     {"Width": ("X", [1, 2, 3])},
...     coords={"X": [1, 2, 3]},
...     attrs={"units": "m"},
... )
>>> b = xr.Dataset(
...     {"Width": ("X", [1, 2, 3])},
...     coords={"X": [1, 2, 3]},
...     attrs={"units": "m"},
... )
>>> c = xr.Dataset(
...     {"Width": ("X", [1, 2, 3])},
...     coords={"X": [1, 2, 3]},
...     attrs={"units": "ft"},
... )
>>> a
<xarray.Dataset>
Dimensions:  (X: 3)
Coordinates:
* X        (X) int64 1 2 3
Data variables:
Width    (X) int64 1 2 3
Attributes:
units:    m
```
```>>> b
<xarray.Dataset>
Dimensions:  (X: 3)
Coordinates:
* X        (X) int64 1 2 3
Data variables:
Width    (X) int64 1 2 3
Attributes:
units:    m
```
```>>> c
<xarray.Dataset>
Dimensions:  (X: 3)
Coordinates:
* X        (X) int64 1 2 3
Data variables:
Width    (X) int64 1 2 3
Attributes:
units:    ft
```
```>>> a.equals(b)
True
```
```>>> a.identical(b)
True
```
```>>> a.equals(c)
True
```
```>>> a.identical(c)
False
```