> I'd like to shift the columns of a 2d array one column to the right.
> Is there a way to do that without making a copy?


I think what you want is numpy.roll?

Definition:     numpy.roll(a, shift, axis=None)
Docstring:
     Roll the elements in the array by 'shift' positions along
     the given axis.

     >>> from numpy import roll
     >>> arange(10)
     array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
     >>> roll(arange(10), 2)
     array([8, 9, 0, 1, 2, 3, 4, 5, 6, 7])

Zach
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to