Re: [Numpy-discussion] Array2 subset of array1

2014-08-05 Thread Eelco Hoogendoorn
ah yes, that may indeed be what you want. depending on your datatype, you could access the underlying raw data as a string. b.tostring() in a.tostring() sort of works; but isn't entirely safe, as you may have false positive matches which arnt aligned to your datatype using str.find in combination

Re: [Numpy-discussion] Array2 subset of array1

2014-08-05 Thread Sebastian Berg
On Di, 2014-08-05 at 14:58 +0200, Jurgens de Bruin 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 >

Re: [Numpy-discussion] Array2 subset of array1

2014-08-05 Thread Eelco Hoogendoorn
np.all(np.in1d(array1,array2)) On Tue, Aug 5, 2014 at 2:58 PM, Jurgens de Bruin 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

Re: [Numpy-discussion] Array2 subset of array1

2014-08-05 Thread Nathaniel Smith
On Tue, Aug 5, 2014 at 1:58 PM, Jurgens de Bruin 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

[Numpy-discussion] Array2 subset of array1

2014-08-05 Thread Jurgens de Bruin
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. T