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

Method test_ptp

numpy/ma/tests/test_old_ma.py:884–897  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

882 assert_(eq(clipped._data, mx._data.clip(2, 8)))
883
884 def test_ptp(self):
885 _, X, _, m, mx, mX, _ = self._create_data()
886 n, m = X.shape
887 # print(type(mx), mx.compressed())
888 # raise Exception()
889 assert_equal(mx.ptp(), np.ptp(mx.compressed()))
890 rows = np.zeros(n, np.float64)
891 cols = np.zeros(m, np.float64)
892 for k in range(m):
893 cols[k] = np.ptp(mX[:, k].compressed())
894 for k in range(n):
895 rows[k] = np.ptp(mX[k].compressed())
896 assert_(eq(mX.ptp(0), cols))
897 assert_(eq(mX.ptp(1), rows))
898
899 def test_swapaxes(self):
900 _, _, _, _, _, mX, mXX = self._create_data()

Callers

nothing calls this directly

Calls 6

_create_dataMethod · 0.95
assert_equalFunction · 0.90
assert_Function · 0.90
eqFunction · 0.85
ptpMethod · 0.45
compressedMethod · 0.45

Tested by

no test coverage detected