Re: [Numpy-discussion] numpy type mismatch

2011-06-13 Thread Olivier Delalleau
2011/6/10 Olivier Delalleau > 2011/6/10 Charles R Harris > >> >> >> On Fri, Jun 10, 2011 at 3:43 PM, Benjamin Root wrote: >> >>> >>> >>> On Fri, Jun 10, 2011 at 3:24 PM, Charles R Harris < >>> charlesr.har...@gmail.com> wrote: >>> On Fri, Jun 10, 2011 at 2:17 PM, Benjamin Root w

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Mark Wiebe
On Fri, Jun 10, 2011 at 9:55 PM, Benjamin Root wrote: > > > On Fri, Jun 10, 2011 at 8:51 PM, Keith Goodman wrote: > >> On Fri, Jun 10, 2011 at 6:35 PM, Charles R Harris >> wrote: >> > On Fri, Jun 10, 2011 at 5:19 PM, Olivier Delalleau >> wrote: >> >> >> But isn't it a bug if numpy.dtype('i') !=

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Benjamin Root
On Fri, Jun 10, 2011 at 10:34 PM, Olivier Delalleau wrote: > 2011/6/10 Benjamin Root > >> >> >> On Fri, Jun 10, 2011 at 9:29 PM, Olivier Delalleau wrote: >> >>> >>> 2011/6/10 Olivier Delalleau >>> 2011/6/10 Charles R Harris > > > On Fri, Jun 10, 2011 at 5:19 PM, Olivier

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Charles R Harris
On Fri, Jun 10, 2011 at 9:10 PM, Benjamin Root wrote: > > > On Fri, Jun 10, 2011 at 9:29 PM, Olivier Delalleau wrote: > >> >> 2011/6/10 Olivier Delalleau >> >>> 2011/6/10 Charles R Harris >>> On Fri, Jun 10, 2011 at 5:19 PM, Olivier Delalleau wrote: > 2011/6/10 Charles

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Olivier Delalleau
2011/6/10 Benjamin Root > > > On Fri, Jun 10, 2011 at 9:29 PM, Olivier Delalleau wrote: > >> >> 2011/6/10 Olivier Delalleau >> >>> 2011/6/10 Charles R Harris >>> On Fri, Jun 10, 2011 at 5:19 PM, Olivier Delalleau wrote: > 2011/6/10 Charles R Harris > >> >>

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Benjamin Root
On Fri, Jun 10, 2011 at 9:29 PM, Olivier Delalleau wrote: > > 2011/6/10 Olivier Delalleau > >> 2011/6/10 Charles R Harris >> >>> >>> >>> On Fri, Jun 10, 2011 at 5:19 PM, Olivier Delalleau wrote: >>> 2011/6/10 Charles R Harris > > > On Fri, Jun 10, 2011 at 3:43 PM, Benjami

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Benjamin Root
On Fri, Jun 10, 2011 at 9:03 PM, Pauli Virtanen wrote: > On Fri, 10 Jun 2011 18:51:14 -0700, Keith Goodman wrote: > [clip] > > Maybe this is the same question, but are you maybe yes, maybe no on this > > too: > > > > >>> type(np.sum([1, 2, 3], dtype=np.int32)) == np.int32 > > False > > No

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Benjamin Root
On Fri, Jun 10, 2011 at 8:51 PM, Keith Goodman wrote: > On Fri, Jun 10, 2011 at 6:35 PM, Charles R Harris > wrote: > > On Fri, Jun 10, 2011 at 5:19 PM, Olivier Delalleau > wrote: > > >> But isn't it a bug if numpy.dtype('i') != numpy.dtype('l') on a 32 bit > >> computer where both are int32? >

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Olivier Delalleau
2011/6/10 Olivier Delalleau > 2011/6/10 Charles R Harris > >> >> >> On Fri, Jun 10, 2011 at 5:19 PM, Olivier Delalleau wrote: >> >>> 2011/6/10 Charles R Harris >>> On Fri, Jun 10, 2011 at 3:43 PM, Benjamin Root wrote: > > > On Fri, Jun 10, 2011 at 3:24 PM, Char

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Pauli Virtanen
On Fri, 10 Jun 2011 18:51:14 -0700, Keith Goodman wrote: [clip] > Maybe this is the same question, but are you maybe yes, maybe no on this > too: > > >>> type(np.sum([1, 2, 3], dtype=np.int32)) == np.int32 > False Note that this is a comparison between two Python types... > Ben, what hap

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Pauli Virtanen
On Fri, 10 Jun 2011 19:35:30 -0600, Charles R Harris wrote: [clip] > Maybe yes, maybe no ;) They have different descriptors, so from numpy's > perspective they are different, but at the hardware/precision level they > are the same. It's more of a decision as to what != means in this case. > Since

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Keith Goodman
On Fri, Jun 10, 2011 at 6:35 PM, Charles R Harris wrote: > On Fri, Jun 10, 2011 at 5:19 PM, Olivier Delalleau wrote: >> But isn't it a bug if numpy.dtype('i') != numpy.dtype('l') on a 32 bit >> computer where both are int32? >> > > Maybe yes, maybe no ;) They have different descriptors, so from

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Olivier Delalleau
2011/6/10 Charles R Harris > > > On Fri, Jun 10, 2011 at 5:19 PM, Olivier Delalleau wrote: > >> 2011/6/10 Charles R Harris >> >>> >>> >>> On Fri, Jun 10, 2011 at 3:43 PM, Benjamin Root wrote: >>> On Fri, Jun 10, 2011 at 3:24 PM, Charles R Harris < charlesr.har...@gmail.com>

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Charles R Harris
On Fri, Jun 10, 2011 at 5:19 PM, Olivier Delalleau wrote: > 2011/6/10 Charles R Harris > >> >> >> On Fri, Jun 10, 2011 at 3:43 PM, Benjamin Root wrote: >> >>> >>> >>> On Fri, Jun 10, 2011 at 3:24 PM, Charles R Harris < >>> charlesr.har...@gmail.com> wrote: >>> On Fri, Jun 10, 201

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Olivier Delalleau
2011/6/10 Charles R Harris > > > On Fri, Jun 10, 2011 at 3:43 PM, Benjamin Root wrote: > >> >> >> On Fri, Jun 10, 2011 at 3:24 PM, Charles R Harris < >> charlesr.har...@gmail.com> wrote: >> >>> >>> >>> On Fri, Jun 10, 2011 at 2:17 PM, Benjamin Root wrote: >>> On Fri, Jun 10, 2011

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Charles R Harris
On Fri, Jun 10, 2011 at 3:43 PM, Benjamin Root wrote: > > > On Fri, Jun 10, 2011 at 3:24 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Fri, Jun 10, 2011 at 2:17 PM, Benjamin Root wrote: >> >>> >>> >>> On Fri, Jun 10, 2011 at 3:02 PM, Charles R Harris < >>> charlesr.har

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Benjamin Root
On Fri, Jun 10, 2011 at 3:24 PM, Charles R Harris wrote: > > > On Fri, Jun 10, 2011 at 2:17 PM, Benjamin Root wrote: > >> >> >> On Fri, Jun 10, 2011 at 3:02 PM, Charles R Harris < >> charlesr.har...@gmail.com> wrote: >> >>> >>> >>> On Fri, Jun 10, 2011 at 1:50 PM, Benjamin Root wrote: >>>

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Charles R Harris
On Fri, Jun 10, 2011 at 2:17 PM, Benjamin Root wrote: > > > On Fri, Jun 10, 2011 at 3:02 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Fri, Jun 10, 2011 at 1:50 PM, Benjamin Root wrote: >> >>> Came across an odd error while using numpy master. Note, my system is >>> 3

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Benjamin Root
On Friday, June 10, 2011, Olivier Delalleau wrote: > It's ok to have two different dtypes (in the sense that "d1 is not d2") such > that they represent the same kind of data (in the sense that d1 == d2). Note that the memory addresses for int64, float32 and float64 accumulators did match the exp

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Olivier Delalleau
2011/6/10 Benjamin Root > > > On Fri, Jun 10, 2011 at 3:02 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Fri, Jun 10, 2011 at 1:50 PM, Benjamin Root wrote: >> >>> Came across an odd error while using numpy master. Note, my system is >>> 32-bits. >>> >>> >>> import num

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Benjamin Root
On Fri, Jun 10, 2011 at 3:02 PM, Charles R Harris wrote: > > > On Fri, Jun 10, 2011 at 1:50 PM, Benjamin Root wrote: > >> Came across an odd error while using numpy master. Note, my system is >> 32-bits. >> >> >>> import numpy as np >> >>> type(np.sum([1, 2, 3], dtype=np.int32)) == np.int32 >>

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Olivier Delalleau
It's ok to have two different dtypes (in the sense that "d1 is not d2") such that they represent the same kind of data (in the sense that d1 == d2). However I think your very first test should have returned True (for what it's worth, it returns true with 1.5.1 on Windows 32 bit). -=- Olivier 201

Re: [Numpy-discussion] numpy type mismatch

2011-06-10 Thread Charles R Harris
On Fri, Jun 10, 2011 at 1:50 PM, Benjamin Root wrote: > Came across an odd error while using numpy master. Note, my system is > 32-bits. > > >>> import numpy as np > >>> type(np.sum([1, 2, 3], dtype=np.int32)) == np.int32 > False > >>> type(np.sum([1, 2, 3], dtype=np.int64)) == np.int64 > True >

[Numpy-discussion] numpy type mismatch

2011-06-10 Thread Benjamin Root
Came across an odd error while using numpy master. Note, my system is 32-bits. >>> import numpy as np >>> type(np.sum([1, 2, 3], dtype=np.int32)) == np.int32 False >>> type(np.sum([1, 2, 3], dtype=np.int64)) == np.int64 True >>> type(np.sum([1, 2, 3], dtype=np.float32)) == np.float32 True >>> typ