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

Method test_diag2d

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

Source from the content-addressed store, hash-verified

70 [0, 0, 1, 0]]))
71
72 def test_diag2d(self):
73 assert_equal(eye(3, 4, k=2),
74 array([[0, 0, 1, 0],
75 [0, 0, 0, 1],
76 [0, 0, 0, 0]]))
77
78 assert_equal(eye(4, 3, k=-2),
79 array([[0, 0, 0],
80 [0, 0, 0],
81 [1, 0, 0],
82 [0, 1, 0]]))
83
84 def test_eye_bounds(self):
85 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