Hi all,

Other data languages that I have worked with have a routine for shifting data along axes, with wrapping.
In IDL it's called 'shift', and works such that
print, a
0 1 2 3
4 5 6 7
8 9 10 11

print, shift(a, 2, 0)
2 3 0 1
6 7 4 5
10 11 8 9

print, shift(a, 2, 1)
10 11 8 9
2 3 0 1
6 7 4 5

In pdl (pdl.perl.org) the equivalent routine is called rotate. Is there a version of this in numpy, or can it be easily achieved using existing technology - I could do it with multiple sliced assignment statements but that seems very clunky and likely slow. I've looked through the examples and the numpy book but without success.

Angus.
--
AJC McMorland, PhD Student
Physiology, University of Auckland
Armourer, Auckland University Fencing
Secretary, Fencing North Inc.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to