NumPy参考 >数组对象 >数据类型对象(dtype) >numpy.dtype > numpy.dtype.subdtype
属性
dtype.
subdtype
如果描述了子数组,则为元组,否则为None。(item_dtype, shape)dtype
(item_dtype, shape)
dtype
该形状是由该数据类型所描述的子阵列的固定形状,并且item_dtype阵列的数据类型。
如果检索到其dtype对象具有此属性的字段,则形状隐含的额外维将附加到检索到的数组的末尾。
也可以看看
dtype.base
例子
>>> x = numpy.dtype('8f') >>> x.subdtype (dtype('float32'), (8,))
>>> x = numpy.dtype('i2') >>> x.subdtype >>>