MCPcopy
hub / github.com/numpy/numpy / test_diag

Method test_diag

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

Source from the content-addressed store, hash-verified

63 array([[0, 1, 0, 0], [0, 0, 1, 0]]))
64
65 def test_diag(self):
66 assert_equal(eye(4, k=1),
67 array([[0, 1, 0, 0],
68 [0, 0, 1, 0],
69 [0, 0, 0, 1],
70 [0, 0, 0, 0]]))
71
72 assert_equal(eye(4, k=-1),
73 array([[0, 0, 0, 0],
74 [1, 0, 0, 0],
75 [0, 1, 0, 0],
76 [0, 0, 1, 0]]))
77
78 def test_2d(self):
79 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