To get the type, use the builtin type
function. With the in
operator, you can test if the type is a numpy type by checking if it contains the string numpy
;
In [1]: import numpy as np
In [2]: a = np.array([1, 2, 3])
In [3]: type(a)
Out[3]: <type 'numpy.ndarray'>
In [4]: 'numpy' in str(type(a))
Out[4]: True
(This example was run in IPython, by the way. Very handy for interactive use and quick tests.)