[Numpy-discussion] Help Understanding Indexing Behavior

Sturla Molden sturla.molden at gmail.com
Wed Feb 26 10:45:54 EST 2014


JB <jonathan.j.buck at gmail.com> wrote:

> 
> x = np.array([1,2,3,4,5,6,7,8,9,10])
> 
> If I want the first 5 elements, what do I do? 

x[:5]




More information about the NumPy-Discussion mailing list