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

Method test_axis

numpy/_core/tests/test_multiarray.py:5852–5860  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5850
5851class TestCompress:
5852 def test_axis(self):
5853 tgt = [[5, 6, 7, 8, 9]]
5854 arr = np.arange(10).reshape(2, 5)
5855 out = np.compress([0, 1], arr, axis=0)
5856 assert_equal(out, tgt)
5857
5858 tgt = [[1, 3], [6, 8]]
5859 out = np.compress([0, 1, 0, 1, 0], arr, axis=1)
5860 assert_equal(out, tgt)
5861
5862 def test_truncate(self):
5863 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