Behaviour of numpy.random.shuffle

Yves yves.frederix at gmail.com
Thu Oct 26 10:50:06 EDT 2006


Hi,

It seems that random.shuffle does not 'shuffle' anymore when presented
with an n-dimensional array. 

	In [1]: import numpy as N

	In [2]: a = N.arange(5).reshape((5,1))

	In [3]: a
	Out[3]: 
	array([[0],
		   [1],
		   [2],
		   [3],
		   [4]])

	In [4]: N.random.shuffle(a) 

	In [5]: a
	Out[5]: 
	array([[0],
		   [1],
		   [1],
		   [3],
		   [3]])

	In [6]: N.__version__   
	Out[6]: '1.0.dev3390'

After application some rows appear to be duplicated. Is this
documented/intended behaviour?

Cheers,
YVES


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the NumPy-Discussion mailing list