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

Method test_ddof

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

Source from the content-addressed store, hash-verified

7142 assert_(res is tgt)
7143
7144 def test_ddof(self):
7145 rmat, _, _ = self._create_data()
7146 for f in [_var]:
7147 for ddof in range(3):
7148 dim = rmat.shape[1]
7149 tgt = f(rmat, axis=1) * dim
7150 res = f(rmat, axis=1, ddof=ddof) * (dim - ddof)
7151 for f in [_std]:
7152 for ddof in range(3):
7153 dim = rmat.shape[1]
7154 tgt = f(rmat, axis=1) * np.sqrt(dim)
7155 res = f(rmat, axis=1, ddof=ddof) * np.sqrt(dim - ddof)
7156 assert_almost_equal(res, tgt)
7157 assert_almost_equal(res, tgt)
7158
7159 def test_ddof_too_big(self):
7160 rmat, _, _ = self._create_data()

Callers

nothing calls this directly

Calls 3

_create_dataMethod · 0.95
assert_almost_equalFunction · 0.90
fFunction · 0.70

Tested by

no test coverage detected