ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> numpy-discussion
numpy-discussion
[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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved