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

Method test_axis_keyword

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

Source from the content-addressed store, hash-verified

4493 assert_equal(np.median(a).ndim, 0)
4494
4495 def test_axis_keyword(self):
4496 a3 = np.array([[2, 3],
4497 [0, 1],
4498 [6, 7],
4499 [4, 5]])
4500 for a in [a3, np.random.randint(0, 100, size=(2, 3, 4))]:
4501 orig = a.copy()
4502 np.median(a, axis=None)
4503 for ax in range(a.ndim):
4504 np.median(a, axis=ax)
4505 assert_array_equal(a, orig)
4506
4507 assert_allclose(np.median(a3, axis=0), [3, 4])
4508 assert_allclose(np.median(a3.T, axis=1), [3, 4])
4509 assert_allclose(np.median(a3), 3.5)
4510 assert_allclose(np.median(a3, axis=None), 3.5)
4511 assert_allclose(np.median(a3.T), 3.5)
4512
4513 def test_overwrite_keyword(self):
4514 a3 = np.array([[2, 3],

Callers

nothing calls this directly

Calls 3

assert_array_equalFunction · 0.90
assert_allcloseFunction · 0.90
copyMethod · 0.45

Tested by

no test coverage detected