import numpy as np a = np.array([1, 2, 3]) isinstance(a, np.ndarray)
>>> import numpy as np a = np.array([1, 2, 3]) >>> type(a) <type 'numpy.ndarray'> >>> type(a).__module__ 'numpy' >>> type(a).__module__ == np.__name__ True