Re: [Numpy-discussion] comparison between arrays of strings and numerical types

2010-08-31 Thread Keith Goodman
2010/8/31 Ernest Adrogué eadro...@gmx.net: Hi, I find this a bit odd: In [18]: np.array(['a','b','c','d']) 'a' Out[18]: array([False,  True,  True,  True], dtype=bool) In [19]: np.array(['a','b','c','d']) 4 Out[19]: True In [20]: np.array(['a','b','c','d']) 4.5 Out[20]: True Is

Re: [Numpy-discussion] comparison between arrays of strings and numerical types

2010-08-31 Thread Ernest Adrogué
31/08/10 @ 09:44 (-0700), thus spake Keith Goodman: 2010/8/31 Ernest Adrogué eadro...@gmx.net: Hi, I find this a bit odd: In [18]: np.array(['a','b','c','d']) 'a' Out[18]: array([False,  True,  True,  True], dtype=bool) In [19]: np.array(['a','b','c','d']) 4 Out[19]: True

Re: [Numpy-discussion] Comparison of arrays

2009-02-09 Thread Francesc Alted
A Monday 09 February 2009, Nils Wagner escrigué: Hi all, I have two integer arrays of different shape, e.g. a array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) b array([ 3, 4, 5, 6, 7, 8, 9, 10]) How can I extract the values that belong to the array a exclusively i.e.

Re: [Numpy-discussion] Comparison of arrays

2009-02-09 Thread Nils Wagner
On Mon, 9 Feb 2009 09:45:02 +0100 Francesc Alted fal...@pytables.org wrote: A Monday 09 February 2009, Nils Wagner escrigué: Hi all, I have two integer arrays of different shape, e.g. a array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) b array([ 3, 4, 5, 6, 7, 8, 9, 10]) How

Re: [Numpy-discussion] Comparison of arrays

2009-02-09 Thread Neil
I have two integer arrays of different shape, e.g. a array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) b array([ 3, 4, 5, 6, 7, 8, 9, 10]) How can I extract the values that belong to the array a exclusively i.e. array([1,2]) ? You could also use numpy.setmember1d

Re: [Numpy-discussion] Comparison of arrays

2009-02-09 Thread Francesc Alted
A Monday 09 February 2009, Neil escrigué: I have two integer arrays of different shape, e.g. a array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) b array([ 3, 4, 5, 6, 7, 8, 9, 10]) How can I extract the values that belong to the array a exclusively i.e.

Re: [Numpy-discussion] Comparison of arrays

2009-02-09 Thread Brent Pedersen
On Mon, Feb 9, 2009 at 6:02 AM, Neil neilcrigh...@gmail.com wrote: I have two integer arrays of different shape, e.g. a array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) b array([ 3, 4, 5, 6, 7, 8, 9, 10]) How can I extract the values that belong to the array a