[Numpy-discussion] dtype 'groups'

Pauli Virtanen pav@iki...
Fri Nov 6 19:20:32 CST 2009


pe, 2009-11-06 kello 19:10 -0500, David Warde-Farley kirjoitti:
> Just to confirm my suspicions, what's the preferred way to check if a  
> dtype is...
> 
> a) an integer type vs. a floating point type vs. a string type? I'm  
> assuming dt.kind.
> b) a compound type vs. a builtin dtype? I'm assuming dt.isbuiltin.

The scalar types form a hierarchy [1], so isinstance on dtype.type might
work for a)? No idea about canonicality here.

.. [1] http://docs.scipy.org/doc/numpy/reference/arrays.scalars.html

-- 
Pauli Virtanen




More information about the NumPy-Discussion mailing list