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

Method test_axis

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

Source from the content-addressed store, hash-verified

5035
5036class TestCompress:
5037 def test_axis(self):
5038 tgt = [[5, 6, 7, 8, 9]]
5039 arr = np.arange(10).reshape(2, 5)
5040 out = np.compress([0, 1], arr, axis=0)
5041 assert_equal(out, tgt)
5042
5043 tgt = [[1, 3], [6, 8]]
5044 out = np.compress([0, 1, 0, 1, 0], arr, axis=1)
5045 assert_equal(out, tgt)
5046
5047 def test_truncate(self):
5048 tgt = [[1], [6]]

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
reshapeMethod · 0.80
compressMethod · 0.80

Tested by

no test coverage detected