[Numpy-discussion] why does b[:-0] not work, and is there an elegant solution?.

Travis Oliphant oliphant@enthought....
Wed Aug 19 18:40:25 CDT 2009


Use N = len(b) and then b[:N-n]

-Travis

--
(mobile phone of)
Travis Oliphant
Enthought, Inc.
1-512-536-1057
http://www.enthought.com

On Aug 19, 2009, at 7:25 AM, Mark Bakker <markbak@gmail.com> wrote:

> Hello list,
>
> I compute the index of the last term in an array that I need and  
> call the index n.
>
> I can then call the array b as
>
> b[:-n]
>
> If I need all terms in the array, the logical syntax would be:
>
> b[:-0]
>
> but that doesn't work. Any reason why that has not been implemented?  
> Any elegant workaround?
>
> Thanks, Mark
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion


More information about the NumPy-Discussion mailing list