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

Function np_corr_ind

xarray/tests/test_computation.py:1669–1680  ·  view source on GitHub ↗
(ts1, ts2, a, x)

Source from the content-addressed store, hash-verified

1667 if dim is not None:
1668
1669 def np_corr_ind(ts1, ts2, a, x):
1670 # Ensure the ts are aligned and missing values ignored
1671 ts1, ts2 = broadcast(ts1, ts2)
1672 valid_values = ts1.notnull() & ts2.notnull()
1673
1674 ts1 = ts1.where(valid_values)
1675 ts2 = ts2.where(valid_values)
1676
1677 return np.ma.corrcoef(
1678 np.ma.masked_invalid(ts1.sel(a=a, x=x).data.flatten()),
1679 np.ma.masked_invalid(ts2.sel(a=a, x=x).data.flatten()),
1680 )[0, 1]
1681
1682 expected = np.zeros((3, 4))
1683 for a in [0, 1, 2]:

Callers 1

test_corrFunction · 0.85

Calls 4

broadcastFunction · 0.90
notnullMethod · 0.45
whereMethod · 0.45
selMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…