numpy.dtype.alignment — NumPy v2.6.dev0 Manual

attribute

dtype.alignment

#

The required alignment (bytes) of this data-type according to the compiler.

More information is available in the C-API section of the manual.

Examples

>>> importnumpyasnp>>> x=np.dtype(np.int32)>>> x.alignment4>>> x=np.dtype(np.float64)>>> x.alignment8