numpy.ndarray.shape

ndarray.shape

Tuple of array dimensions.

Examples

>>> x = np.array([1,2,3,4])
>>> x.shape
(4,)
>>> y = np.zeros((4,5,6))
>>> y.shape
(4, 5, 6)
>>> y.shape = (2, 5, 2, 3, 2)
>>> y.shape
(2, 5, 2, 3, 2)

Previous topic

numpy.ndarray.flags

Next topic

numpy.ndarray.strides

This Page

Quick search