[SciPy-user] reverse an array

Ravi lists_ravi@lavabit....
Mon Mar 2 09:41:01 CST 2009


On Friday 27 February 2009 22:02:30 Williamson, Ross wrote:
> Is there an easy way to reverse an array without converting it to a list?

Two ways:
   x = array([0,1,2,3,4])
   y1 = flipud( x ) # See also fliplr
   y2 = x[ ::-1 ]

Regards,
Ravi




More information about the SciPy-user mailing list