NumPy - Creating Arrays
What is the output of the following code?
import numpy as np print(np.eye(3, 5, k=2))
import numpy as np print(np.eye(3, 5, k=2))
np.eye(3, 5, k=2) creates a 3x5 matrix with ones on the diagonal shifted 2 above the main diagonal.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions