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

Method test_squeeze

numpy/core/tests/test_multiarray.py:2007–2012  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2005 check_round(np.array([12.5 + 15.5j]), [10 + 20j], -1)
2006
2007 def test_squeeze(self):
2008 a = np.array([[[1], [2], [3]]])
2009 assert_equal(a.squeeze(), [1, 2, 3])
2010 assert_equal(a.squeeze(axis=(0,)), [[1], [2], [3]])
2011 assert_raises(ValueError, a.squeeze, axis=(1,))
2012 assert_equal(a.squeeze(axis=(2,)), [[1, 2, 3]])
2013
2014 def test_transpose(self):
2015 a = np.array([[1, 2], [3, 4]])

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
assert_raisesFunction · 0.90
squeezeMethod · 0.45

Tested by

no test coverage detected