MCPcopy
hub / github.com/numpy/numpy / test_diag2d

Method test_diag2d

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

Source from the content-addressed store, hash-verified

88 [0, 0, 1, 0]]))
89
90 def test_diag2d(self):
91 assert_equal(eye(3, 4, k=2),
92 array([[0, 0, 1, 0],
93 [0, 0, 0, 1],
94 [0, 0, 0, 0]]))
95
96 assert_equal(eye(4, 3, k=-2),
97 array([[0, 0, 0],
98 [0, 0, 0],
99 [1, 0, 0],
100 [0, 1, 0]]))
101
102 def test_eye_bounds(self):
103 assert_equal(eye(2, 2, 1), [[0, 1], [0, 0]])

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
eyeFunction · 0.90
arrayFunction · 0.90

Tested by

no test coverage detected