MCPcopy
hub / github.com/numpy/numpy / test_basic

Method test_basic

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

Source from the content-addressed store, hash-verified

902class TestApplyOverAxes:
903 # Tests apply_over_axes
904 def test_basic(self):
905 a = arange(24).reshape(2, 3, 4)
906 test = apply_over_axes(np.sum, a, [0, 2])
907 ctrl = np.array([[[60], [92], [124]]])
908 assert_equal(test, ctrl)
909 a[(a % 2).astype(bool)] = masked
910 test = apply_over_axes(np.sum, a, [0, 2])
911 ctrl = np.array([[[28], [44], [60]]])
912 assert_equal(test, ctrl)
913
914
915class TestMedian:

Callers

nothing calls this directly

Calls 4

apply_over_axesFunction · 0.90
assert_equalFunction · 0.90
reshapeMethod · 0.80
astypeMethod · 0.80

Tested by

no test coverage detected