[Numpy-discussion] use slicing as argument values?

Pauli Virtanen pav@iki...
Fri Jul 13 05:20:44 CDT 2012


Benjamin Root <ben.root <at> ou.edu> writes:
[clip]
> a[sl] and a[3:5, 5:14] is equivalent to 
> sl = (slice(3, 5), slice(5, 14))
> a[sl]
[clip]

which is also equivalent to

    sl = np.s_[3:5, 5:14]




More information about the NumPy-Discussion mailing list