MCPcopy Index your code
hub / github.com/pydata/xarray / equals

Method equals

xarray/core/variable.py:1877–1893  ·  view source on GitHub ↗

True if two Variables have the same dimensions and values; otherwise False. Variables can still be equal (like pandas objects) if they have NaN values in the same locations. This method is necessary because `v1 == v2` for Variables does element-wise comparis

(self, other, equiv=duck_array_ops.array_equiv)

Source from the content-addressed store, hash-verified

1875 return cls(dims, data, attrs, encoding, fastpath=True)
1876
1877 def equals(self, other, equiv=duck_array_ops.array_equiv):
1878 """True if two Variables have the same dimensions and values;
1879 otherwise False.
1880
1881 Variables can still be equal (like pandas objects) if they have NaN
1882 values in the same locations.
1883
1884 This method is necessary because `v1 == v2` for Variables
1885 does element-wise comparisons (like numpy.ndarrays).
1886 """
1887 other = getattr(other, "variable", other)
1888 try:
1889 return self.dims == other.dims and (
1890 self._data is other._data or equiv(self.data, other.data)
1891 )
1892 except (TypeError, AttributeError):
1893 return False
1894
1895 def broadcast_equals(self, other, equiv=duck_array_ops.array_equiv):
1896 """True if two Variables have the values after being broadcast against

Callers 7

broadcast_equalsMethod · 0.95
identicalMethod · 0.95
test_broadcast_equalsMethod · 0.95
test_no_conflictsMethod · 0.95
equalsMethod · 0.45
_data_equalsMethod · 0.45

Calls

no outgoing calls

Tested by 3

test_broadcast_equalsMethod · 0.76
test_no_conflictsMethod · 0.76