Re: [Numpy-discussion] integer array creation oddity

2008-07-23 Thread Suchindra Sandhu
Thanks Everyone. On Mon, Jul 21, 2008 at 6:25 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > On Mon, Jul 21, 2008 at 3:37 PM, Stéfan van der Walt <[EMAIL PROTECTED]> > wrote: > >> 2008/7/21 Suchindra Sandhu <[EMAIL PROTECTED]>: >> > Is that the recommended way of checking the type of the a

Re: [Numpy-discussion] integer array creation oddity

2008-07-21 Thread Charles R Harris
On Mon, Jul 21, 2008 at 3:37 PM, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: > 2008/7/21 Suchindra Sandhu <[EMAIL PROTECTED]>: > > 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 > > n

Re: [Numpy-discussion] integer array creation oddity

2008-07-21 Thread Stéfan van der Walt
2008/7/21 Suchindra Sandhu <[EMAIL PROTECTED]>: > 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 differe

Re: [Numpy-discussion] integer array creation oddity

2008-07-21 Thread Suchindra Sandhu
Hi Stéfan, 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? Thanks, Suchindra On Fri,

Re: [Numpy-discussion] integer array creation oddity

2008-07-18 Thread Stéfan van der Walt
2008/7/18 Suchindra Sandhu <[EMAIL PROTECTED]>: > 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]: There's more than one int32 type lying around. Rather, compare *dtypes*: In [19]: a.dtype == np.in

[Numpy-discussion] integer array creation oddity

2008-07-18 Thread Suchindra Sandhu
Hi, 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]: In [10]: type(a[0]) == n.int32 Out[10]: False When I create an array with 'int', 'int32' etc it works fine What is the type of 'i' and what is n.int0? Th