数据类型类 ( numpy.dtypes )#

本模块包含与特定dtypes相关的功能及其类.有关dtypes的更多常规信息,另请参见 numpy.dtype数据类型对象 ( dtype ) .

与内置的 types 模块类似,此子模块定义了不直接广泛使用的类型(类).

在 NumPy 版本加入: 1.25

dtypes模块是NumPy 1.25中的新功能.以前,DType类只能间接访问.

DType 类#

以下是相应NumPy dtype实例和NumPy标量类型的类.这些类可以在 isinstance 检查中使用,也可以直接实例化或使用.直接使用这些类并不常见,因为它们的标量对应项(例如 np.float64 )或诸如 "float64" 之类的字符串可以使用.

布尔型#

numpy.dtypes.BoolDType[源代码]#

位大小的整数#

numpy.dtypes.Int8DType[源代码]#
numpy.dtypes.UInt8DType#
numpy.dtypes.Int16DType#
numpy.dtypes.UInt16DType#
numpy.dtypes.Int32DType#
numpy.dtypes.UInt32DType#
numpy.dtypes.Int64DType#
numpy.dtypes.UInt64DType#

C命名的整数(可能是别名)#

numpy.dtypes.ByteDType[源代码]#
numpy.dtypes.UByteDType#
numpy.dtypes.ShortDType#
numpy.dtypes.UShortDType#
numpy.dtypes.IntDType#
numpy.dtypes.UIntDType#
numpy.dtypes.LongDType#
numpy.dtypes.ULongDType#
numpy.dtypes.LongLongDType#
numpy.dtypes.ULongLongDType#

浮点数#

numpy.dtypes.Float16DType[源代码]#
numpy.dtypes.Float32DType#
numpy.dtypes.Float64DType#
numpy.dtypes.LongDoubleDType#

复数#

numpy.dtypes.Complex64DType[源代码]#
numpy.dtypes.Complex128DType#
numpy.dtypes.CLongDoubleDType#

字符串和Bytestrings#

numpy.dtypes.StrDType[源代码]#
numpy.dtypes.BytesDType#
numpy.dtypes.StringDType#

时间#

numpy.dtypes.DateTime64DType[源代码]#
numpy.dtypes.TimeDelta64DType#

其他#

numpy.dtypes.ObjectDType[源代码]#
numpy.dtypes.VoidDType#