|
From: Mads I. <mp...@os...> - 2006-02-22 19:40:52
|
On Wed, 22 Feb 2006, Alan G Isaac wrote: > On Wed, 22 Feb 2006, Zachary Pincus apparently wrote: > > Does numpy have an built-in mechanism to shift elements along some > > axis in an array? (e.g. to "roll" [0,1,2,3] by some offset, here 2, > > to make [2,3,0,1]) > > This sounds like the rotater command in GAUSS. > As far as I know there is no equivalent in numpy. > Please post your ultimate solution. > > Cheers, > Alan Isaac > Similar to cshift() (cyclic shift) in F90. Very nice for calculating finite differences, such as x' = ( cshift(x,+1) - cshift(x-1) ) / dx This would be a very handy feature indeed. // Mads |