Что делать.
#The shape attribute for numpy arrays returns the dimensions of the array.
#If Y has n rows and m columns, then Y. shape is (n,m) .
import numpy as np
arr= np.array([[6, 1, 2, 1],
[5, 4, 6, 7,],
[6, 7, 2, 1,]])
result = np.shape(arr)
print(result)
#will return (3,4)
Gandalf