numpy.dtype.alignment#

属性

dtype.alignment#

根据编译器,此数据类型的必需对齐(字节)。

更多信息请参阅手册的 C-API 部分。

示例

>>> import numpy as np
>>> x = np.dtype('i4')
>>> x.alignment
4
>>> x = np.dtype(float)
>>> x.alignment
8