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

Method test_varstd

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

Source from the content-addressed store, hash-verified

918 assert_(eq(mXcp._data, mX.filled(0).cumsum(1)))
919
920 def test_varstd(self):
921 _, X, XX, _, _, mX, mXX = self._create_data()
922 assert_(eq(mX.var(axis=None), mX.compressed().var()))
923 assert_(eq(mX.std(axis=None), mX.compressed().std()))
924 assert_(eq(mXX.var(axis=3).shape, XX.var(axis=3).shape))
925 assert_(eq(mX.var().shape, X.var().shape))
926 (mXvar0, mXvar1) = (mX.var(axis=0), mX.var(axis=1))
927 for k in range(6):
928 assert_(eq(mXvar1[k], mX[k].compressed().var()))
929 assert_(eq(mXvar0[k], mX[:, k].compressed().var()))
930 assert_(eq(np.sqrt(mXvar0[k]),
931 mX[:, k].compressed().std()))
932
933
934def eqmask(m1, m2):

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected