NumPy参考 >数组对象 >数据类型对象(dtype) >numpy.dtype > numpy.dtype.alignment
属性
dtype.
alignment
根据编译器,此数据类型的所需对齐方式(字节)。
手册的C-API部分提供了更多信息。
例子
>>> x = np.dtype('i4') >>> x.alignment 4
>>> x = np.dtype(float) >>> x.alignment 8