Re: [Numpy-discussion] basic numpy array operation

2010-03-15 Thread Robert Kern
On Mon, Mar 15, 2010 at 13:20, gerardo.berbeglia wrote: > > Suppose i have an array A of length n > I want a variable b to be an array consisting of the first k elements of A > and variable c to be an array with the last n-k elements of A. > > How do you do this? > > Example A = np.array([1,2,3,4,

[Numpy-discussion] basic numpy array operation

2010-03-15 Thread gerardo.berbeglia
Suppose i have an array A of length n I want a variable b to be an array consisting of the first k elements of A and variable c to be an array with the last n-k elements of A. How do you do this? Example A = np.array([1,2,3,4,5,6]), k = 2 b = [1,2] c=[3,4,5,6] Thanks. -- View this message in