MCPcopy Index your code
hub / github.com/numpy/numpy / test_unique_inverse_with_axis

Method test_unique_inverse_with_axis

numpy/lib/tests/test_arraysetops.py:1092–1096  ·  view source on GitHub ↗
(self, axis)

Source from the content-addressed store, hash-verified

1090
1091 @pytest.mark.parametrize("axis", [None, 0, -1])
1092 def test_unique_inverse_with_axis(self, axis):
1093 x = np.array([[4, 4, 3], [2, 2, 1], [2, 2, 1], [4, 4, 3]])
1094 uniq, inv = unique(x, return_inverse=True, axis=axis)
1095 assert_equal(inv.ndim, x.ndim if axis is None else 1)
1096 assert_array_equal(x, np.take(uniq, inv, axis=axis))
1097
1098 def test_unique_axis_zeros(self):
1099 # issue 15559

Callers

nothing calls this directly

Calls 4

uniqueFunction · 0.90
assert_equalFunction · 0.90
assert_array_equalFunction · 0.90
takeMethod · 0.80

Tested by

no test coverage detected