[Numpy-discussion] shuffle bug
by Tom Holroyd other posts by this author
Dec 8 2006 6:06PM messages near this date
Re: [Numpy-discussion] griddata in python from x,y,z coordinates
|
Re: [Numpy-discussion] shuffle bug
This is certainly a bug. It has been mentioned before, but there
was no comment.
shuffle() doesn't handle arrays.
> >> from numpy import *
> >> from numpy.random import *
> >> a = arange(12)
> >> a.shape = (6,2)
> >> a
array([[ 0, 1],
[ 2, 3],
[ 4, 5],
[ 6, 7],
[ 8, 9],
[10, 11]])
> >> shuffle(a)
> >> a
array([[ 0, 1],
[ 2, 3],
[ 2, 3],
[ 0, 1],
[ 4, 5],
[10, 11]])
This is with numpy 1.0. The [0, 1] element was duplicated. That's
not right.
Tom Holroyd, Ph.D.
We experience the world not as it is, but as we expect it to be.
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@[...].org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Thread:
Tom Holroyd
Robert Kern
Alan G Isaac
|