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

Method test_unstack_2d

xarray/tests/test_variable.py:1785–1793  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1783 v.unstack(z={"x": 5})
1784
1785 def test_unstack_2d(self):
1786 v = Variable(["x", "y"], [[0, 1], [2, 3]])
1787 actual = v.unstack(y={"z": 2})
1788 expected = Variable(["x", "z"], v.data)
1789 assert_identical(actual, expected)
1790
1791 actual = v.unstack(x={"z": 2})
1792 expected = Variable(["y", "z"], v.data.T)
1793 assert_identical(actual, expected)
1794
1795 def test_stack_unstack_consistency(self):
1796 v = Variable(["x", "y"], [[0, 1], [2, 3]])

Callers

nothing calls this directly

Calls 3

unstackMethod · 0.95
VariableClass · 0.90
assert_identicalFunction · 0.90

Tested by

no test coverage detected