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

Method test_empty

numpy/lib/tests/test_function_base.py:2560–2567  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2558 assert_allclose(np.corrcoef(x, y), np.array([[1., -1.j], [1.j, 1.]]))
2559
2560 def test_empty(self):
2561 with warnings.catch_warnings(record=True):
2562 warnings.simplefilter('always', RuntimeWarning)
2563 assert_array_equal(corrcoef(np.array([])), np.nan)
2564 assert_array_equal(corrcoef(np.array([]).reshape(0, 2)),
2565 np.array([]).reshape(0, 0))
2566 assert_array_equal(corrcoef(np.array([]).reshape(2, 0)),
2567 np.array([[np.nan, np.nan], [np.nan, np.nan]]))
2568
2569 def test_extreme(self):
2570 x = [[1e-100, 1e100], [1e100, 1e-100]]

Callers

nothing calls this directly

Calls 3

assert_array_equalFunction · 0.90
corrcoefFunction · 0.90
reshapeMethod · 0.80

Tested by

no test coverage detected