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

Method test_basic

numpy/lib/tests/test_function_base.py:733–743  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

731class TestPtp:
732
733 def test_basic(self):
734 a = np.array([3, 4, 5, 10, -3, -5, 6.0])
735 assert_equal(np.ptp(a, axis=0), 15.0)
736 b = np.array([[3, 6.0, 9.0],
737 [4, 10.0, 5.0],
738 [8, 3.0, 2.0]])
739 assert_equal(np.ptp(b, axis=0), [5.0, 7.0, 7.0])
740 assert_equal(np.ptp(b, axis=-1), [6.0, 6.0, 6.0])
741
742 assert_equal(np.ptp(b, axis=0, keepdims=True), [[5.0, 7.0, 7.0]])
743 assert_equal(np.ptp(b, axis=(0, 1), keepdims=True), [[8.0]])
744
745
746class TestCumsum:

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
ptpMethod · 0.45

Tested by

no test coverage detected