[Numpy-discussion] extract elements of an array that are contained in another array?
Thu Jun 4 07:35:05 CDT 2009
On Thu, Jun 4, 2009 at 8:23 AM, Alan G Isaac <email@example.com> wrote:
this is my preferred way when b is small and has unique elements.
if the elements in b are not unique, then be can be replaced by np.unique(b)
If b is large this creates a huge intermediate array
The advantage of the new setmember1d_nu is that it handles large b
very efficiently. My try on it was more than 10 times slower than the
proposed solution for larger arrays.
> Alan Isaac
More information about the Numpy-discussion