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

Method test_std

numpy/core/tests/test_numeric.py:243–252  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

241 assert_equal(np.squeeze([np.zeros((3, 1))], axis=-1).shape, (1, 3))
242
243 def test_std(self):
244 A = [[1, 2, 3], [4, 5, 6]]
245 assert_almost_equal(np.std(A), 1.707825127659933)
246 assert_almost_equal(np.std(A, 0), np.array([1.5, 1.5, 1.5]))
247 assert_almost_equal(np.std(A, 1), np.array([0.81649658, 0.81649658]))
248
249 with warnings.catch_warnings(record=True) as w:
250 warnings.filterwarnings('always', '', RuntimeWarning)
251 assert_(np.isnan(np.std([])))
252 assert_(w[0].category is RuntimeWarning)
253
254 def test_swapaxes(self):
255 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