[Numpy-discussion] deleting value from array
Nadav Horesh
nadavh@visionsense....
Thu Aug 16 05:04:35 CDT 2007
The closest I can think of is:
a = a[range(len(a)) != 1]
Nadav.
On Wed, 2007-08-15 at 02:07 -0700, mark wrote:
> I am trying to delete a value from an array
> This seems to work as follows
>
> >>> a = array([1,2,3,4])
> >>> a = delete( a, 1 )
> >>> a
> array([1, 3, 4])
>
> But wouldn't it make more sense to have a function like
>
> a.delete(1) ?
>
> I now get the feeling the delete command needs to copy the entire
> array with exception of the deleted item. I guess this is a hard thing
> to do efficiently?
>
> Thanks,
>
> Mark
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070816/288580e7/attachment.html
More information about the Numpy-discussion
mailing list