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

Method test_ptp

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

Source from the content-addressed store, hash-verified

819 assert_(eq(clipped._data, mx._data.clip(2, 8)))
820
821 def test_ptp(self):
822 (x, X, XX, m, mx, mX, mXX,) = self.d
823 (n, m) = X.shape
824 assert_equal(mx.ptp(), mx.compressed().ptp())
825 rows = np.zeros(n, np.float_)
826 cols = np.zeros(m, np.float_)
827 for k in range(m):
828 cols[k] = mX[:, k].compressed().ptp()
829 for k in range(n):
830 rows[k] = mX[k].compressed().ptp()
831 assert_(eq(mX.ptp(0), cols))
832 assert_(eq(mX.ptp(1), rows))
833
834 def test_swapaxes(self):
835 (x, X, XX, m, mx, mX, mXX,) = self.d

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected