DAWorkbench 0.0.1
DAWorkbench API
载入中...
搜索中...
未找到
DA::DAPyDType类 参考

对numpy.dtype的封装 更多...

#include <DAPyDType.h>

类 DA::DAPyDType 继承关系图:
DA::DAPyObjectWrapper

Public 成员函数

 DAPyDType (const DAPyDType &s)
 
 DAPyDType (DAPyDType &&s)
 
 DAPyDType (const pybind11::object &obj)
 
 DAPyDType (pybind11::object &&obj)
 
 DAPyDType (const pybind11::dtype &obj)
 
 DAPyDType (pybind11::dtype &&obj)
 
 DAPyDType (const QString &dtypename)
 
DAPyDTypeoperator= (const pybind11::dtype &obj)
 
DAPyDTypeoperator= (const pybind11::object &obj)
 
DAPyDTypeoperator= (const DAPyDType &obj)
 
DAPyDTypeoperator= (const DAPyObjectWrapper &obj)
 
bool operator== (const DAPyDType &other) const
 判断两个dtype是否是一个类型
 
bool operator!= (const DAPyDType &other) const
 
pybind11::object type (const QVariant &v) const
 
QString name () const
 
char kind () const
 
char char_ () const
 
int num () const
 
bool isInt () const
 
bool isUInt () const
 
bool isFloat () const
 
bool isTimedelta () const
 
bool isDatetime () const
 
bool isComplex () const
 
bool isBool () const
 
bool isStr () const
 
bool isNumeral () const
 是否为数字
 
- Public 成员函数 继承自 DA::DAPyObjectWrapper
 DAPyObjectWrapper (const DAPyObjectWrapper &obj)
 
 DAPyObjectWrapper (DAPyObjectWrapper &&obj)
 
 DAPyObjectWrapper (const pybind11::object &obj)
 
 DAPyObjectWrapper (pybind11::object &&obj)
 
bool isNone () const
 
DAPyObjectWrapperoperator= (const DAPyObjectWrapper &obj)
 
DAPyObjectWrapperoperator= (DAPyObjectWrapper &&obj)
 
DAPyObjectWrapperoperator= (const pybind11::object &obj)
 
DAPyObjectWrapperoperator= (pybind11::object &&obj)
 
bool operator== (void *ptr) const
 
bool operator== (const pybind11::object &obj) const
 
bool operator== (const DAPyObjectWrapper &obj) const
 
bool operator!= (void *ptr) const
 
bool operator!= (const pybind11::object &obj) const
 
bool operator!= (const DAPyObjectWrapper &obj) const
 
 operator bool () const
 
void dealException (const std::exception &e) const
 统一的异常处理函数
 
DAPyObjectWrapper deepCopy () const
 深拷贝
 
pybind11::object & object ()
 
const pybind11::object & object () const
 
QVariant toVariant () const
 
bool isinstance (const pybind11::handle &type) const
 
bool isInt () const
 是否为int
 
bool isModule () const
 是否为Module
 
bool isFloat () const
 是否为float
 
bool isStr () const
 是否为str
 
bool isBool () const
 
bool isList () const
 
bool isDict () const
 
bool isTuple () const
 
bool isCallable () const
 
bool isSequence () const
 
bool isNumeric () const
 
void setErrCallback (const ErrCallback &fun)
 设置错误处理回调
 
ErrCallback getErrCallback () const
 
pybind11::object attr (const char *c_att)
 获取属性
 
pybind11::object attr (const char *c_att) const
 
template<typename... Args>
pybind11::object call (Args &&... args)
 直接调用Python可调用对象
 
QString __name__ () const
 对应__name__
 
QString __str__ () const
 
QString __repr__ () const
 
QString typeName () const
 
size_t refCount () const
 

静态 Public 成员函数

static bool isDtypeObj (const pybind11::object &obj)
 
static QStringList dtypeNames ()
 获取所有的dtype类型名称
 

Protected 成员函数

void checkObjectValid ()
 

额外继承的成员函数

- Public 类型 继承自 DA::DAPyObjectWrapper
using ErrCallback = std::function< void(const char *) >
 异常错误回调函数
 
- Protected 属性 继承自 DA::DAPyObjectWrapper
pybind11::object _object
 
ErrCallback _errcallback
 

详细描述

对numpy.dtype的封装

python dtype 信息如下: name=bool,kind=b,char=?,str=|b1,num=0 name=int8,kind=i,char=b,str=|i1,num=1 name=int16,kind=i,char=h,str=<i2,num=3 name=int32,kind=i,char=l,str=<i4,num=7 name=int64,kind=i,char=q,str=<i8,num=9 name=uint8,kind=u,char=B,str=|u1,num=2 name=uint16,kind=u,char=H,str=<u2,num=4 name=uint32,kind=u,char=L,str=<u4,num=8 name=uint64,kind=u,char=Q,str=<u8,num=10 name=float16,kind=f,char=e,str=<f2,num=23 name=float32,kind=f,char=f,str=<f4,num=11 name=float64,kind=f,char=d,str=<f8,num=12 name=complex64,kind=c,char=F,str=<c8,num=14 name=complex128,kind=c,char=D,str=<c16,num=15 name=str,kind=U,char=U,str=<U0,num=19 name=datetime64,kind=M,char=M,str=<M8,num=21 name=timedelta64,kind=m,char=m,str=<m8,num=22 name=bytes,kind=S,char=S,str=|S0,num=18 name=void,kind=V,char=V,str=|V0,num=20 name=object,kind=O,char=O,str=|O,num=17

成员函数说明

◆ dtypeNames()

QStringList DAPyDType::dtypeNames ( )
static

获取所有的dtype类型名称

返回

◆ isNumeral()

bool DAPyDType::isNumeral ( ) const

是否为数字

注解
注意,bool和复数不算数字
返回

◆ operator==()

bool DAPyDType::operator== ( const DAPyDType other) const

判断两个dtype是否是一个类型

参数
other
返回

该类的文档由以下文件生成: