9951 explained code solutions for 126 technologies


python-numpyGet Numpy array shape


import numpy as np
arr = np.array([[1, 2], [3, 4], [5, 6]])
shp = arr.shapectrl + c
import numpy as np

load Numpy module for Python

np.array

declare Numpy array

[[1, 2], [3, 4], [5, 6]]

sample multi-dimensional array

.shape

attribute returns shape of given array