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

Method test_var_values

numpy/core/tests/test_multiarray.py:6279–6286  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6277 assert_equal(np.mean(a, where=False), np.nan)
6278
6279 def test_var_values(self):
6280 for mat in [self.rmat, self.cmat, self.omat]:
6281 for axis in [0, 1, None]:
6282 msqr = _mean(mat * mat.conj(), axis=axis)
6283 mean = _mean(mat, axis=axis)
6284 tgt = msqr - mean * mean.conjugate()
6285 res = _var(mat, axis=axis)
6286 assert_almost_equal(res, tgt)
6287
6288 @pytest.mark.parametrize(('complex_dtype', 'ndec'), (
6289 ('complex64', 6),

Callers

nothing calls this directly

Calls 4

assert_almost_equalFunction · 0.90
conjugateMethod · 0.80
_meanFunction · 0.70
_varFunction · 0.70

Tested by

no test coverage detected