Re: [Numpy-discussion] yet another trivial question

2012-11-02 Thread Nathaniel Smith
On Fri, Nov 2, 2012 at 2:18 PM, Neal Becker wrote: > I'm trying to convert some matlab code. I see this: > > b(1)=[]; > > AFAICT, this removes the first element of the array, shifting the others. > > What is the preferred numpy equivalent? Perhaps np.delete is what you're looking for. (Esp. if y

Re: [Numpy-discussion] yet another trivial question

2012-11-02 Thread David Warde-Farley
On Fri, Nov 2, 2012 at 11:16 AM, Joe Kington wrote: > On Fri, Nov 2, 2012 at 9:18 AM, Neal Becker wrote: > >> I'm trying to convert some matlab code. I see this: >> >> b(1)=[]; >> >> AFAICT, this removes the first element of the array, shifting the others. >> >> What is the preferred numpy equi

Re: [Numpy-discussion] yet another trivial question

2012-11-02 Thread Joe Kington
On Fri, Nov 2, 2012 at 9:18 AM, Neal Becker wrote: > I'm trying to convert some matlab code. I see this: > > b(1)=[]; > > AFAICT, this removes the first element of the array, shifting the others. > > What is the preferred numpy equivalent? > > I'm not sure if > > b[:] = b[1:] > Unless I'm missi

[Numpy-discussion] yet another trivial question

2012-11-02 Thread Neal Becker
I'm trying to convert some matlab code. I see this: b(1)=[]; AFAICT, this removes the first element of the array, shifting the others. What is the preferred numpy equivalent? I'm not sure if b[:] = b[1:] is safe or not ___ NumPy-Discussion mailing