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

Method test_var_values

numpy/_core/tests/test_multiarray.py:7244–7252  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

7242 assert_equal(np.mean(a, where=False), np.nan)
7243
7244 def test_var_values(self):
7245 rmat, cmat, omat = self._create_data()
7246 for mat in [rmat, cmat, omat]:
7247 for axis in [0, 1, None]:
7248 msqr = _mean(mat * mat.conj(), axis=axis)
7249 mean = _mean(mat, axis=axis)
7250 tgt = msqr - mean * mean.conjugate()
7251 res = _var(mat, axis=axis)
7252 assert_almost_equal(res, tgt)
7253
7254 @pytest.mark.parametrize(('complex_dtype', 'ndec'), (
7255 ('complex64', 6),

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected