[Numpy-discussion] extract elements of an array that are contained in another array?
ningsean at gmail.com
Wed Jun 3 20:29:31 EDT 2009
Hi, I want to extract elements of an array (say, a) that are contained in
another array (say, b). That is, if a=array([1,1,2,3,3,4]), b=array([1,4]),
then I want array([1,1,4]).
I did the following but the speed is very slow (maybe because a is very
for x in b:
any way to speed it up?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion