numpy.dtype¶
-
class
numpy.dtype[source]¶ - Attributes
alignmentThe required alignment (bytes) of this data-type according to the compiler.
baseReturns dtype for the base element of the subarrays, regardless of their dimension or shape.
byteorderA character indicating the byte-order of this data-type object.
charA unique character code for each of the 21 different built-in types.
descr__array_interface__ description of the data-type.
fieldsDictionary of named fields defined for this data type, or
None.flagsBit-flags describing how this data type is to be interpreted.
hasobjectBoolean indicating whether this dtype contains any reference-counted objects in any fields or sub-dtypes.
isalignedstructBoolean indicating whether the dtype is a struct which maintains field alignment.
isbuiltinInteger indicating how this dtype relates to the built-in dtypes.
isnativeBoolean indicating whether the byte order of this dtype is native to the platform.
itemsizeThe element size of this data-type object.
kindA character code (one of ‘biufcmMOSUV’) identifying the general kind of data.
- metadata
nameA bit-width name for this data-type.
namesOrdered list of field names, or
Noneif there are no fields.ndimNumber of dimensions of the sub-array if this data type describes a sub-array, and
0otherwise.numA unique number for each of the 21 different built-in types.
shapeShape tuple of the sub-array if this data type describes a sub-array, and
()otherwise.strThe array-protocol typestring of this data-type object.
subdtypeTuple
(item_dtype, shape)if thisdtypedescribes a sub-array, and None otherwise.- type
Methods
newbyteorder([new_order])Return a new dtype with a different byte order.