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

Method test_compress

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

Source from the content-addressed store, hash-verified

4870 assert_equal(test, m.reshape(2, 2))
4871
4872 def test_compress(self):
4873 # Test compress function on ndarray and masked array
4874 # Address Github #2495.
4875 arr = np.arange(8)
4876 arr.shape = 4, 2
4877 cond = np.array([True, False, True, True])
4878 control = arr[[0, 2, 3]]
4879 test = np.ma.compress(cond, arr, axis=0)
4880 assert_equal(test, control)
4881 marr = np.ma.array(arr)
4882 test = np.ma.compress(cond, marr, axis=0)
4883 assert_equal(test, control)
4884
4885 def test_compressed(self):
4886 # Test ma.compressed function.

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
compressMethod · 0.80

Tested by

no test coverage detected