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

Method test_std

numpy/_core/tests/test_numeric.py:303–312  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

301 assert_equal(np.squeeze([np.zeros((3, 1))], axis=-1).shape, (1, 3))
302
303 def test_std(self):
304 A = [[1, 2, 3], [4, 5, 6]]
305 assert_almost_equal(np.std(A), 1.707825127659933)
306 assert_almost_equal(np.std(A, 0), np.array([1.5, 1.5, 1.5]))
307 assert_almost_equal(np.std(A, 1), np.array([0.81649658, 0.81649658]))
308
309 with warnings.catch_warnings(record=True) as w:
310 warnings.filterwarnings('always', '', RuntimeWarning)
311 assert_(np.isnan(np.std([])))
312 assert_(w[0].category is RuntimeWarning)
313
314 def test_swapaxes(self):
315 tgt = [[[0, 4], [2, 6]], [[1, 5], [3, 7]]]

Callers

nothing calls this directly

Calls 3

assert_almost_equalFunction · 0.90
assert_Function · 0.90
stdMethod · 0.45

Tested by

no test coverage detected