Re: [Numpy-discussion] numpy.random.permutation bug?

2007-01-18 Thread Keith Goodman
On 1/18/07, Keith Goodman <[EMAIL PROTECTED]> wrote: > On 1/18/07, Robert Kern <[EMAIL PROTECTED]> wrote: > > Yes. 1.2 is not an integer. In Emanuele's example, a.sum() was an integer, > > though not an int. > > Sorry, but I'm still confused. Does that mean that this is the > expected behaviour? >

Re: [Numpy-discussion] numpy.random.permutation bug?

2007-01-18 Thread Keith Goodman
On 1/18/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Yes. 1.2 is not an integer. In Emanuele's example, a.sum() was an integer, > though not an int. Sorry, but I'm still confused. Does that mean that this is the expected behaviour? >> numpy.random.permutation(1) array([0]) whereas >> numpy.rand

Re: [Numpy-discussion] numpy.random.permutation bug?

2007-01-18 Thread Robert Kern
Keith Goodman wrote: > On 1/18/07, Robert Kern <[EMAIL PROTECTED]> wrote: >> Keith Goodman wrote: >>> I don't think that bug is particular to int32. For example: >>> > numpy.random.permutation(1.2) >>> TypeError: len() of unsized object >> Well, that should raise an error, though maybe not that

Re: [Numpy-discussion] numpy.random.permutation bug?

2007-01-18 Thread Keith Goodman
On 1/18/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Keith Goodman wrote: > > I don't think that bug is particular to int32. For example: > > > >>> numpy.random.permutation(1.2) > > TypeError: len() of unsized object > > Well, that should raise an error, though maybe not that error. Is my example

Re: [Numpy-discussion] numpy.random.permutation bug?

2007-01-18 Thread Emanuele Olivetti
Robert Kern wrote: > Emanuele Olivetti wrote: > > >> permutation() likes 'int' and dislikes 'numpy.int32' integers :( >> Seems a bug. >> > > Yup. I should get around to fixing it later tonight. > > Wow. Superfast! :) Emanuele ___ Numpy-discus

Re: [Numpy-discussion] numpy.random.permutation bug?

2007-01-18 Thread Robert Kern
Emanuele Olivetti wrote: > permutation() likes 'int' and dislikes 'numpy.int32' integers :( > Seems a bug. Yup. I should get around to fixing it later tonight. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad atte

Re: [Numpy-discussion] numpy.random.permutation bug?

2007-01-18 Thread Robert Kern
Keith Goodman wrote: > I don't think that bug is particular to int32. For example: > >>> numpy.random.permutation(1.2) > TypeError: len() of unsized object Well, that should raise an error, though maybe not that error. -- Robert Kern "I have come to believe that the whole world is an enigma, a

Re: [Numpy-discussion] numpy.random.permutation bug?

2007-01-18 Thread Alan G Isaac
Confirmed for numpy 1.0. Cheers, Alan Isaac ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] numpy.random.permutation bug?

2007-01-18 Thread Keith Goodman
On 1/18/07, Emanuele Olivetti <[EMAIL PROTECTED]> wrote: > Look at this: > > --bug.py--- > import numpy > a=numpy.array([1,2]) > b=a.sum() > print type(b) > c=numpy.random.permutation(b) > --- > > If I run it (Python 2.5, numpy 1.0.1 on a Linux box) I get: >

[Numpy-discussion] numpy.random.permutation bug?

2007-01-18 Thread Emanuele Olivetti
Look at this: --bug.py--- import numpy a=numpy.array([1,2]) b=a.sum() print type(b) c=numpy.random.permutation(b) --- If I run it (Python 2.5, numpy 1.0.1 on a Linux box) I get: --- #> python /tmp/bug.py Traceback (most recent call last): File "/tmp/bug.