numpy array get shape code example
Example 1: numpy shape
>>> a = np.array([(1, 2), (3, 4)], dtype=[('x', 'i4'), ('y', 'i4')])
>>> np.shape(a)
(2,)
>>> a.shape
(2,)
Example 2: np arange shape
np.arange(12).reshape(3,4)
Example 3: create empty numpy array without shape
a = []
for x in y:
a.append(x)
a = np.array(a)