[Numpy-discussion] Array2 subset of array1

Eelco Hoogendoorn hoogendoorn.eelco at gmail.com
Tue Aug 5 11:29:00 EDT 2014


np.all(np.in1d(array1,array2))


On Tue, Aug 5, 2014 at 2:58 PM, Jurgens de Bruin <debruinjj at gmail.com>
wrote:

> Hi,
>
> I am new to numpy so any help would be greatly appreciated.
>
> I have two arrays:
>
>     array1 = np.arange(1,100+1)
>     array2 = np.arange(1,50+1)
>
> How can I calculate/determine if array2 is a subset of array1 (falls
> within array 1)
>
> Something like : array2 in array1 = TRUE for the case above.
>
> Thank
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140805/63a5e5e6/attachment.html>


More information about the NumPy-Discussion mailing list