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

Travis Oliphant oliphant at enthought.com
Wed Aug 19 19:40:25 EDT 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 at 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 at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion



More information about the NumPy-Discussion mailing list