We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d49014d + ff2545f commit ed71fbbCopy full SHA for ed71fbb
xarray/core/variable.py
@@ -1247,6 +1247,19 @@ def copy(self, deep=True):
1247
return type(self)(self.dims, self._data, self._attrs,
1248
self._encoding, fastpath=True)
1249
1250
+ def equals(self, other, equiv=None):
1251
+ # if equiv is specified, super up
1252
+ if equiv is not None:
1253
+ return super(IndexVariable, self).equals(other, equiv)
1254
+
1255
+ # otherwise use the native index equals, rather than looking at _data
1256
+ other = getattr(other, 'variable', other)
1257
+ try:
1258
+ return (self.dims == other.dims and
1259
+ self._data_equals(other))
1260
+ except (TypeError, AttributeError):
1261
+ return False
1262
1263
def _data_equals(self, other):
1264
return self.to_index().equals(other.to_index())
1265
0 commit comments