How do I find out if a numpy array contains integers?

Found it in the numpy book! Page 23:

The other types in the hierarchy define particular categories of types.
These categories can be useful for testing whether or not the object
returned by self.dtype.type is of a particular class (using issubclass).

issubclass(n.dtype('int8').type, n.integer)
>>> True
issubclass(n.dtype('int16').type, n.integer)
>>> True

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)