Write a NumPy program to create an array which looks like below array.
import numpy as np x = np.triu(np.arange(2, 14).reshape(4, 3), -1) print(x)
Sample Output:
[[ 2 3 4] [ 5 6 7] [ 0 9 10] [ 0 0 13]]
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer