numpy.lib.format.descr_to_dtype#
- lib.format.descr_to_dtype(descr)[源代码]#
返回基于给定描述的 dtype.
这本质上是 dtype_to_descr 的逆向操作.它将移除由 dtype(‘float32’) 这样的简单字段创建的无值填充字段,然后将描述转换为其对应的 dtype.
- 参数:
- descrobject
由 dtype.descr 检索的对象.可以传递给
numpy.dtype以复制输入 dtype.
- 返回:
- dtypedtype
由描述构造的 dtype.