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

Method test_varstd

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

Source from the content-addressed store, hash-verified

853 assert_(eq(mXcp._data, mX.filled(0).cumsum(1)))
854
855 def test_varstd(self):
856 (x, X, XX, m, mx, mX, mXX,) = self.d
857 assert_(eq(mX.var(axis=None), mX.compressed().var()))
858 assert_(eq(mX.std(axis=None), mX.compressed().std()))
859 assert_(eq(mXX.var(axis=3).shape, XX.var(axis=3).shape))
860 assert_(eq(mX.var().shape, X.var().shape))
861 (mXvar0, mXvar1) = (mX.var(axis=0), mX.var(axis=1))
862 for k in range(6):
863 assert_(eq(mXvar1[k], mX[k].compressed().var()))
864 assert_(eq(mXvar0[k], mX[:, k].compressed().var()))
865 assert_(eq(np.sqrt(mXvar0[k]),
866 mX[:, k].compressed().std()))
867
868
869def eqmask(m1, m2):

Callers

nothing calls this directly

Calls 5

assert_Function · 0.90
eqFunction · 0.85
varMethod · 0.45
compressedMethod · 0.45
stdMethod · 0.45

Tested by

no test coverage detected