Q:

Write a NumPy program to find the number of rows and columns of a given matrix

0

Write a NumPy program to find the number of rows and columns of a given matrix.

All Answers

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

import numpy as np
m= np.arange(10,22).reshape((3, 4))
print("Original matrix:")
print(m)
print("Number of rows and columns of the said matrix:")
print(m.shape)

Sample Output:

Original matrix:
[[10 11 12 13]
 [14 15 16 17]
 [18 19 20 21]]
Number of rows and columns of the said matrix:
(3, 4)

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