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

Method test_squeeze

numpy/core/tests/test_numeric.py:231–241  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

229 assert_(np.size(A, 1) == 3)
230
231 def test_squeeze(self):
232 A = [[[1, 1, 1], [2, 2, 2], [3, 3, 3]]]
233 assert_equal(np.squeeze(A).shape, (3, 3))
234 assert_equal(np.squeeze(np.zeros((1, 3, 1))).shape, (3,))
235 assert_equal(np.squeeze(np.zeros((1, 3, 1)), axis=0).shape, (3, 1))
236 assert_equal(np.squeeze(np.zeros((1, 3, 1)), axis=-1).shape, (1, 3))
237 assert_equal(np.squeeze(np.zeros((1, 3, 1)), axis=2).shape, (1, 3))
238 assert_equal(np.squeeze([np.zeros((3, 1))]).shape, (3,))
239 assert_equal(np.squeeze([np.zeros((3, 1))], axis=0).shape, (3, 1))
240 assert_equal(np.squeeze([np.zeros((3, 1))], axis=2).shape, (1, 3))
241 assert_equal(np.squeeze([np.zeros((3, 1))], axis=-1).shape, (1, 3))
242
243 def test_std(self):
244 A = [[1, 2, 3], [4, 5, 6]]

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
squeezeMethod · 0.45

Tested by

no test coverage detected