On 04/09/2012 09:11 PM, Tony Yu wrote:
I guess I wasn't reading very carefully and assumed that you meant a
list of `slice(None)` instead of a list of `None`.
My apologies to Ben...I wasn't being pedantic to be a jerk, I was being
pedantic because I read Ben's message and thought oooh, that
On Tue, Apr 10, 2012 at 12:52 PM, Jonathan T. Niehof jnie...@lanl.govwrote:
On 04/09/2012 09:11 PM, Tony Yu wrote:
I guess I wasn't reading very carefully and assumed that you meant a
list of `slice(None)` instead of a list of `None`.
My apologies to Ben...I wasn't being pedantic to be a
On 04/06/2012 06:54 AM, Benjamin Root wrote:
Take a peek at how np.gradient() does it. It creates a list of None with
a length equal to the number of dimensions, and then inserts a slice
object in the appropriate spot in the list.
List of slice(None), correct? At least that's what I see in
On Mon, Apr 9, 2012 at 12:14 PM, Jonathan T. Niehof jnie...@lanl.govwrote:
On 04/06/2012 06:54 AM, Benjamin Root wrote:
Take a peek at how np.gradient() does it. It creates a list of None with
a length equal to the number of dimensions, and then inserts a slice
object in the appropriate
On Mon, Apr 9, 2012 at 12:22 PM, Benjamin Root ben.r...@ou.edu wrote:
On Mon, Apr 9, 2012 at 12:14 PM, Jonathan T. Niehof jnie...@lanl.govwrote:
On 04/06/2012 06:54 AM, Benjamin Root wrote:
Take a peek at how np.gradient() does it. It creates a list of None with
a length equal to the
On Friday, April 6, 2012, Val Kalatsky wrote:
The only slicing short-cut I can think of is the Ellipsis object, but it's
not going to help you much here.
The alternatives that come to my mind are (1) manipulation of shape
directly and (2) building a string and running eval on it.
Your
On Fri, Apr 6, 2012 at 8:54 AM, Benjamin Root ben.r...@ou.edu wrote:
On Friday, April 6, 2012, Val Kalatsky wrote:
The only slicing short-cut I can think of is the Ellipsis object, but
it's not going to help you much here.
The alternatives that come to my mind are (1) manipulation of
Hi,
On Fri, Apr 6, 2012 at 1:12 PM, Tony Yu tsy...@gmail.com wrote:
On Fri, Apr 6, 2012 at 8:54 AM, Benjamin Root ben.r...@ou.edu wrote:
On Friday, April 6, 2012, Val Kalatsky wrote:
The only slicing short-cut I can think of is the Ellipsis object, but
it's not going to help you much
Is there a way to slice an nd-array along a specified axis? It's easy to
slice along a fixed axis, e.g.:
axis = 0:
array[start:end]
axis = 1:
array[:, start:end]
...
But I need to do this inside of a function that accepts arrays of any
dimension, and the user can operate on any axis of the
The only slicing short-cut I can think of is the Ellipsis object, but it's
not going to help you much here.
The alternatives that come to my mind are (1) manipulation of shape
directly and (2) building a string and running eval on it.
Your solution is better than (1), and (2) is a horrible hack,
10 matches
Mail list logo