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

Function array_equiv

xarray/core/duck_array_ops.py:361–372  ·  view source on GitHub ↗

Like np.array_equal, but also allows values to be NaN in both arrays

(arr1, arr2)

Source from the content-addressed store, hash-verified

359
360
361def array_equiv(arr1, arr2):
362 """Like np.array_equal, but also allows values to be NaN in both arrays"""
363 arr1 = asarray(arr1)
364 arr2 = asarray(arr2)
365 lazy_equiv = lazy_array_equiv(arr1, arr2)
366 if lazy_equiv is None:
367 with warnings.catch_warnings():
368 warnings.filterwarnings("ignore", "In the future, 'NAT == x'")
369 flag_array = (arr1 == arr2) | (isnull(arr1) & isnull(arr2))
370 return bool(array_all(flag_array))
371 else:
372 return lazy_equiv
373
374
375def array_notnull_equiv(arr1, arr2):

Callers 1

compare_attrFunction · 0.90

Calls 4

asarrayFunction · 0.85
lazy_array_equivFunction · 0.85
isnullFunction · 0.85
array_allFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…