MCPcopy
hub / github.com/pydata/xarray / identical

Method identical

xarray/core/dataset.py:1698–1772  ·  view source on GitHub ↗

Like equals, but also checks all dataset attributes, the attributes on all variables and coordinates, and indexes. Examples -------- >>> a = xr.Dataset( ... {"Width": ("X", [1, 2, 3])}, ... coords={"X": [1, 2, 3]}, ... attrs={"uni

(self, other: Self)

Source from the content-addressed store, hash-verified

1696 return False
1697
1698 def identical(self, other: Self) -> bool:
1699 """Like equals, but also checks all dataset attributes, the
1700 attributes on all variables and coordinates, and indexes.
1701
1702 Examples
1703 --------
1704
1705 >>> a = xr.Dataset(
1706 ... {"Width": ("X", [1, 2, 3])},
1707 ... coords={"X": [1, 2, 3]},
1708 ... attrs={"units": "m"},
1709 ... )
1710 >>> b = xr.Dataset(
1711 ... {"Width": ("X", [1, 2, 3])},
1712 ... coords={"X": [1, 2, 3]},
1713 ... attrs={"units": "m"},
1714 ... )
1715 >>> c = xr.Dataset(
1716 ... {"Width": ("X", [1, 2, 3])},
1717 ... coords={"X": [1, 2, 3]},
1718 ... attrs={"units": "ft"},
1719 ... )
1720 >>> a
1721 <xarray.Dataset> Size: 48B
1722 Dimensions: (X: 3)
1723 Coordinates:
1724 * X (X) int64 24B 1 2 3
1725 Data variables:
1726 Width (X) int64 24B 1 2 3
1727 Attributes:
1728 units: m
1729
1730 >>> b
1731 <xarray.Dataset> Size: 48B
1732 Dimensions: (X: 3)
1733 Coordinates:
1734 * X (X) int64 24B 1 2 3
1735 Data variables:
1736 Width (X) int64 24B 1 2 3
1737 Attributes:
1738 units: m
1739
1740 >>> c
1741 <xarray.Dataset> Size: 48B
1742 Dimensions: (X: 3)
1743 Coordinates:
1744 * X (X) int64 24B 1 2 3
1745 Data variables:
1746 Width (X) int64 24B 1 2 3
1747 Attributes:
1748 units: ft
1749
1750 >>> a.equals(b)
1751 True
1752
1753 >>> a.identical(b)
1754 True
1755

Calls 1

_all_compatMethod · 0.95