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

Method test_basic

numpy/ma/tests/test_extras.py:816–824  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

814class TestApplyOverAxes:
815 # Tests apply_over_axes
816 def test_basic(self):
817 a = arange(24).reshape(2, 3, 4)
818 test = apply_over_axes(np.sum, a, [0, 2])
819 ctrl = np.array([[[60], [92], [124]]])
820 assert_equal(test, ctrl)
821 a[(a % 2).astype(bool)] = masked
822 test = apply_over_axes(np.sum, a, [0, 2])
823 ctrl = np.array([[[28], [44], [60]]])
824 assert_equal(test, ctrl)
825
826
827class TestMedian:

Callers

nothing calls this directly

Calls 5

apply_over_axesFunction · 0.90
assert_equalFunction · 0.90
arangeFunction · 0.85
reshapeMethod · 0.80
astypeMethod · 0.80

Tested by

no test coverage detected