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

Method test_reindex_like

xarray/tests/test_dataarray.py:1830–1838  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1828 assert_identical(orig4.broadcast_like(orig3), new4)
1829
1830 def test_reindex_like(self) -> None:
1831 foo = DataArray(np.random.randn(5, 6), [("x", range(5)), ("y", range(6))])
1832 bar = foo[:2, :2]
1833 assert_identical(foo.reindex_like(bar), bar)
1834
1835 expected = foo.copy()
1836 expected[:] = np.nan
1837 expected[:2, :2] = bar
1838 assert_identical(bar.reindex_like(foo), expected)
1839
1840 def test_reindex_like_no_index(self) -> None:
1841 foo = DataArray(np.random.randn(5, 6), dims=["x", "y"])

Callers

nothing calls this directly

Calls 5

reindex_likeMethod · 0.95
copyMethod · 0.95
DataArrayClass · 0.90
assert_identicalFunction · 0.90
reindex_likeMethod · 0.45

Tested by

no test coverage detected