[Numpy-discussion] integer array creation oddity
Mon Jul 21 07:30:24 CDT 2008
Is that the recommended way of checking the type of the array? Ususally for
type checkin, I use the isinstance built-in in python, but I see that will
not work in this case. I must admit that I am a little confused by this. Why
is type different from dtype?
On Fri, Jul 18, 2008 at 7:10 PM, Stéfan van der Walt <firstname.lastname@example.org>
> 2008/7/18 Suchindra Sandhu <email@example.com>:
> > Can someone please explain to me this oddity?
> > In : import numpy as n
> > In : a = n.array((1,2,3), 'i')
> > In : type(a)
> > Out: <type 'numpy.int32'>
> There's more than one int32 type lying around. Rather, compare *dtypes*:
> In : a.dtype == np.int32
> Out: True
> Numpy-discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion