Q:

Write a NumPy program to create a 3x3 matrix with values ranging from 2 to 10

-1

Write a NumPy program to create a 3x3 matrix with values ranging from 2 to 10

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np
x =  np.arange(2, 11).reshape(3,3)
print(x)

Sample Output:

[[ 2  3  4]                                                             
 [ 5  6  7]                                                             
 [ 8  9 10]]

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now