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

Method test_diag

numpy/lib/tests/test_twodim_base.py:47–58  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

45 array([[0, 1, 0, 0], [0, 0, 1, 0]]))
46
47 def test_diag(self):
48 assert_equal(eye(4, k=1),
49 array([[0, 1, 0, 0],
50 [0, 0, 1, 0],
51 [0, 0, 0, 1],
52 [0, 0, 0, 0]]))
53
54 assert_equal(eye(4, k=-1),
55 array([[0, 0, 0, 0],
56 [1, 0, 0, 0],
57 [0, 1, 0, 0],
58 [0, 0, 1, 0]]))
59
60 def test_2d(self):
61 assert_equal(eye(4, 3),

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
eyeFunction · 0.90
arrayFunction · 0.90

Tested by

no test coverage detected