Python numpy.dtype.subdtype()函数
numpy.dtype.subdtype()函数如果这个dtype描述了一个子数组,则返回Tuple(item_dtype, shape),否则返回None。
语法: numpy.dtype.subdtype(type)
type : [dtype] 输入的数据类型。
返回 : 如果这个dtype描述了一个子数组,则返回Tuple(item_dtype, shape),否则返回None。
代码#1:
输出 :
代码#2:
输出 :