MCPcopy Create free account
hub / github.com/numpy/numpy / test_permuted

Method test_permuted

numpy/random/tests/test_generator_mt19937.py:1088–1098  ·  view source on GitHub ↗
(self, dtype, axis, expected)

Source from the content-addressed store, hash-verified

1086 (1, np.array([[ 5, 3, 4, 0, 2, 1],
1087 [11, 9, 10, 6, 8, 7]]))])
1088 def test_permuted(self, dtype, axis, expected):
1089 random = Generator(MT19937(self.seed))
1090 x = np.arange(12).reshape(2, 6).astype(dtype)
1091 random.permuted(x, axis=axis, out=x)
1092 assert_array_equal(x, expected)
1093
1094 random = Generator(MT19937(self.seed))
1095 x = np.arange(12).reshape(2, 6).astype(dtype)
1096 y = random.permuted(x, axis=axis)
1097 assert y.dtype == dtype
1098 assert_array_equal(y, expected)
1099
1100 def test_permuted_with_strides(self):
1101 random = Generator(MT19937(self.seed))

Callers

nothing calls this directly

Calls 3

assert_array_equalFunction · 0.90
astypeMethod · 0.80
reshapeMethod · 0.80

Tested by

no test coverage detected