[Numpy-discussion] Allowing slices as arguments for ndarray.take
shoyer at climate.com
Thu Jan 16 19:28:53 EST 2014
There was a discussion last year about slicing along specified axes in
I'm finding that slicing along specified axes is a common task for me when
writing code to manipulate N-D arrays.
The method ndarray.take basically does what I would like, except it cannot
take slice objects as argument. In the mean-time, I've written a little
def take(a, indices, axis):
index = [slice(None)] * a.ndim
index[axis] = indices
Is there support for allowing the `indices` argument to `take` to take
Python slice objects as well as arrays? That would alleviate the need for
my helper function.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion