Using issubdtype to check integer types
![](https://secure.gravatar.com/avatar/af6c39d6943bd4b0e1fde23161e7bb8c.jpg?s=120&d=mm&r=g)
Oct. 14, 2010
8:39 a.m.
Hi all, Is this behaviour correct? In [18]: np.issubdtype(np.uint16, np.uint) Out[18]: False Regards Stéfan
![](https://secure.gravatar.com/avatar/764323a14e554c97ab74177e0bce51d4.jpg?s=120&d=mm&r=g)
October 2010
3:18 p.m.
2010/10/14 Stéfan van der Walt <stefan@sun.ac.za>:
Hi all,
Is this behaviour correct?
In [18]: np.issubdtype(np.uint16, np.uint) Out[18]: False
Yes, it's correct. np.uint is a concrete type that is the platform-specific C unsigned long type: |1> np.uint <type 'numpy.uint32'> The abstract base type is np.unsignedinteger: |3> np.issubdtype(np.uint16, np.unsignedinteger) True -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
5238
Age (days ago)
5238
Last active (days ago)
2 comments
2 participants
participants (2)
-
Robert Kern
-
Stéfan van der Walt