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: > ----------- > #> python /tmp/bug.py > <type 'numpy.int32'> > Traceback (most recent call last): > File "/tmp/bug.py", line 5, in <module> > c=numpy.random.permutation(b) > File "mtrand.pyx", line 1227, in mtrand.RandomState.permutation > File "mtrand.pyx", line 1211, in mtrand.RandomState.shuffle > TypeError: len() of unsized object > ----------- > > permutation() likes 'int' and dislikes 'numpy.int32' integers :( > Seems a bug.
I don't think that bug is particular to int32. For example: >> numpy.random.permutation(1.2) TypeError: len() of unsized object _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion