[Numpy-discussion] Reversing an array in-place
Mon Dec 20 16:36:17 CST 2010
Oh, you're quite right. I should have looked more closely into this.
Thanks for the reply.
On Mon, Dec 20, 2010 at 2:15 PM, Charles R Harris
> On Mon, Dec 20, 2010 at 1:25 PM, Justin Peel <firstname.lastname@example.org> wrote:
>> I noticed that there is currently no way to reverse a numpy array
>> in-place. The current way to reverse a numpy array is using slicing,
>> ala arr[::-1]. This is okay for small matrices, but for really large
>> ones, this can be prohibitive. Not only that, but an in-place reverse
>> is much faster than slicing. It seems like a reverse method could be
>> added to arrays that would reverse the array along a given axis fairly
>> easily. Is there any opposition to this?
> The reversed matrix is a view, no copyihg is done. It is even faster than
> an inplace reversal.
> NumPy-Discussion mailing list
More information about the NumPy-Discussion