numpy.dtype.shape — NumPy v1.24 Manual (original) (raw)
- Array objects
- The N-dimensional array ( ndarray )
- Scalars
- Data type objects ( dtype )
* numpy.dtype
* numpy.dtype.type
* numpy.dtype.kind
* numpy.dtype.char
* numpy.dtype.num
* numpy.dtype.str
* numpy.dtype.name
* numpy.dtype.itemsize
* numpy.dtype.byteorder
* numpy.dtype.fields
* numpy.dtype.names
* numpy.dtype.subdtype
* numpy.dtype.shape
* numpy.dtype.hasobject
* numpy.dtype.flags
* numpy.dtype.isbuiltin
* numpy.dtype.isnative
* numpy.dtype.descr
* numpy.dtype.alignment
* numpy.dtype.base
* numpy.dtype.metadata
* numpy.dtype.newbyteorder
* numpy.dtype.__reduce__
* numpy.dtype.__setstate__
* numpy.dtype.__class_getitem__
* numpy.dtype.__ge__
* numpy.dtype.__gt__
* numpy.dtype.__le__
* numpy.dtype.__lt__ - Indexing routines
- Iterating Over Arrays
- Standard array subclasses
- Masked arrays
- The array interface protocol
- Datetimes and Timedeltas
- Array API Standard Compatibility
- Constants
- Universal functions ( ufunc )
- Routines
- Typing ( numpy.typing )
- Global State
- Packaging ( numpy.distutils )
- NumPy Distutils - Users Guide
- Status of numpy.distutils and migration advice
- NumPy C-API
- CPU/SIMD Optimizations
- NumPy security
- NumPy and SWIG
attribute
dtype.shape#
Shape tuple of the sub-array if this data type describes a sub-array, and ()
otherwise.
Examples
dt = np.dtype(('i4', 4)) dt.shape (4,)
dt = np.dtype(('i4', (2, 3))) dt.shape (2, 3)