[Numpy-discussion] integer array creation oddity

Stéfan van der Walt stefan at sun.ac.za
Fri Jul 18 19:10:57 EDT 2008


2008/7/18 Suchindra Sandhu <suchindra at gmail.com>:
> Can someone please explain to me this oddity?
>
> In [1]: import numpy as n
>
> In [8]: a = n.array((1,2,3), 'i')
>
> In [9]: type(a[0])
> Out[9]: <type 'numpy.int32'>

There's more than one int32 type lying around.  Rather, compare *dtypes*:

In [19]: a.dtype == np.int32
Out[19]: True

Regards
Stéfan



More information about the NumPy-Discussion mailing list