Python numpy:int是一个基本字符串?

Python numpy:int是一个基本字符串?,python,numpy,types,Python,Numpy,Types,为什么numpy数字类型是basestring的子类型 for nptype in [np.int32, np.int64, np.integer, np.float]: for stype in [str, basestring, unicode]: print nptype, stype, np.issubdtype(nptype,stype) <type 'numpy.int32'> <type 'str'> False <type '

为什么
numpy
数字类型是
basestring
的子类型

for nptype in [np.int32, np.int64, np.integer, np.float]:
    for stype in [str, basestring, unicode]:
        print nptype, stype, np.issubdtype(nptype,stype)
<type 'numpy.int32'> <type 'str'> False
<type 'numpy.int32'> <type 'basestring'> True
<type 'numpy.int32'> <type 'unicode'> False
<type 'numpy.int64'> <type 'str'> False
<type 'numpy.int64'> <type 'basestring'> True
<type 'numpy.int64'> <type 'unicode'> False
<type 'numpy.integer'> <type 'str'> False
<type 'numpy.integer'> <type 'basestring'> True
<type 'numpy.integer'> <type 'unicode'> False
<type 'float'> <type 'str'> False
<type 'float'> <type 'basestring'> True
<type 'float'> <type 'unicode'> False
对于[np.int32、np.int64、np.integer、np.float]中的nptype:
对于[str,basestring,unicode]中的stype:
打印nptype,stype,np.issubdtype(nptype,stype)
假的
真的
假的
假的
真的
假的
假的
真的
假的
假的
真的
假的

基本字符串
不是数据类型或无法转换为数据类型,并且
issubdtype
没有识别此错误的错误处理。在
basestring
上获取数据类型,由于
numpy.dtype
看到输入是它不理解的Python类型对象,因此生成的数据类型就是对象dtype。逻辑的其余部分将每个数据类型视为对象数据类型的子数据类型