numpy.dtype.subdtype#
属性
- dtype.subdtype#
如果此
dtype
描述一个子数组,则返回元组(item_dtype, shape)
,否则为 None。shape 是此数据类型描述的子数组的固定形状,而 item_dtype 是该数组的数据类型。
如果检索到其 dtype 对象具有此属性的字段,则 shape 所隐含的额外维度将附加到检索到的数组末尾。
另请参阅
示例
>>> import numpy as np >>> x = np.dtype('8f') >>> x.subdtype (dtype('float32'), (8,))
>>> x = np.dtype('i2') >>> x.subdtype >>>