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

Method test_compress

numpy/ma/tests/test_core.py:5119–5129  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5117 assert_equal(test, m.reshape(2, 2))
5118
5119 def test_compress(self):
5120 # Test compress function on ndarray and masked array
5121 # Address Github #2495.
5122 arr = np.arange(8).reshape(4, 2)
5123 cond = np.array([True, False, True, True])
5124 control = arr[[0, 2, 3]]
5125 test = np.ma.compress(cond, arr, axis=0)
5126 assert_equal(test, control)
5127 marr = np.ma.array(arr)
5128 test = np.ma.compress(cond, marr, axis=0)
5129 assert_equal(test, control)
5130
5131 def test_compressed(self):
5132 # Test ma.compressed function.

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
reshapeMethod · 0.80
compressMethod · 0.80

Tested by

no test coverage detected