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 the source, and: >>> a = numpy.array([[1,2],[3,4]]) >>> operator.getitem(a, (None, slice(1, 2))) array([[[3, 4]]]) >>> operator.getitem(a, (slice(None), slice(1, 2))) array([[2], [4]]) -- Jonathan Niehof ISR-3 Space Data Systems Los Alamos National Laboratory MS-D466 Los Alamos, NM 87545 Phone: 505-667-9595 email: jnie...@lanl.gov Correspondence / Technical data or Software Publicly Available _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion