yet another trivial question

2 Nov
2012
2 Nov
'12
10:18 a.m.
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

2 Nov
2 Nov
3:54 p.m.
On Fri, Nov 2, 2012 at 2:18 PM, Neal Becker ndbecker2@gmail.com 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 you have multiple items to remove like this, or want to remove something besides the first element in the array.)
-n
3800
Age (days ago)
3800
Last active (days ago)
1 comments
2 participants
participants (2)
-
Nathaniel Smith
-
Neal Becker