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

Method test_basic

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

Source from the content-addressed store, hash-verified

627class TestPtp:
628
629 def test_basic(self):
630 a = np.array([3, 4, 5, 10, -3, -5, 6.0])
631 assert_equal(a.ptp(axis=0), 15.0)
632 b = np.array([[3, 6.0, 9.0],
633 [4, 10.0, 5.0],
634 [8, 3.0, 2.0]])
635 assert_equal(b.ptp(axis=0), [5.0, 7.0, 7.0])
636 assert_equal(b.ptp(axis=-1), [6.0, 6.0, 6.0])
637
638 assert_equal(b.ptp(axis=0, keepdims=True), [[5.0, 7.0, 7.0]])
639 assert_equal(b.ptp(axis=(0,1), keepdims=True), [[8.0]])
640
641
642class TestCumsum:

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
ptpMethod · 0.45

Tested by

no test coverage detected