Re: [Numpy-discussion] Multiplicity of an entry

2009-10-27 Thread Michael Droettboom
Travis Oliphant wrote: > On Oct 27, 2009, at 2:31 PM, Michael Droettboom wrote: > > >> Christopher Barker wrote: >> >>> Nadav Horesh wrote: >>> >>> np.equal(a,a).sum(0) but, for unknown reason, np.equal operates only on "normal" arrays. >>> true: >>>

Re: [Numpy-discussion] Multiplicity of an entry

2009-10-27 Thread Travis Oliphant
On Oct 27, 2009, at 2:31 PM, Michael Droettboom wrote: > Christopher Barker wrote: >> Nadav Horesh wrote: >> >>> np.equal(a,a).sum(0) >>> >>> but, for unknown reason, np.equal operates only on "normal" arrays. >>> >> >> true: >> >> In [25]: a >> Out[25]: >> array(['abc', 'def', 'abc', 'ghij'], >>

Re: [Numpy-discussion] Multiplicity of an entry

2009-10-27 Thread Michael Droettboom
Christopher Barker wrote: > Nadav Horesh wrote: > >> np.equal(a,a).sum(0) >> >> but, for unknown reason, np.equal operates only on "normal" arrays. >> > > true: > > In [25]: a > Out[25]: > array(['abc', 'def', 'abc', 'ghij'], >dtype='|S4') > > In [27]: np.equal(a,a) > Out[27]: NotIm

Re: [Numpy-discussion] Multiplicity of an entry

2009-10-27 Thread Christopher Barker
Nadav Horesh wrote: > np.equal(a,a).sum(0) > > but, for unknown reason, np.equal operates only on "normal" arrays. true: In [25]: a Out[25]: array(['abc', 'def', 'abc', 'ghij'], dtype='|S4') In [27]: np.equal(a,a) Out[27]: NotImplemented however: In [28]: a == a Out[28]: array([ True,

Re: [Numpy-discussion] Multiplicity of an entry

2009-10-26 Thread Nadav Horesh
@gmail.com נשלח: ב 26-אוקטובר-09 20:26 אל: Discussion of Numerical Python נושא: Re: [Numpy-discussion] Multiplicity of an entry On Mon, Oct 26, 2009 at 2:12 PM, Christopher Barker wrote: > Alan G Isaac wrote: >> On 10/26/2009 4:04 AM, Nils Wagner wrote: >>> how can I obtain the m

Re: [Numpy-discussion] Multiplicity of an entry

2009-10-26 Thread josef . pktd
On Mon, Oct 26, 2009 at 2:12 PM, Christopher Barker wrote: > Alan G Isaac wrote: >> On 10/26/2009 4:04 AM, Nils Wagner wrote: >>> how can I obtain the multiplicity of an entry in a list >>> a = ['abc','def','abc','ghij'] >> >> That's a Python question, not a NumPy question. > > but we can make it

Re: [Numpy-discussion] Multiplicity of an entry

2009-10-26 Thread Christopher Barker
Alan G Isaac wrote: > On 10/26/2009 4:04 AM, Nils Wagner wrote: >> how can I obtain the multiplicity of an entry in a list >> a = ['abc','def','abc','ghij'] > > That's a Python question, not a NumPy question. but we can make it a numpy question! In [15]: a = np.array(['abc','def','abc','ghij'])

Re: [Numpy-discussion] Multiplicity of an entry

2009-10-26 Thread Alan G Isaac
On 10/26/2009 4:04 AM, Nils Wagner wrote: > how can I obtain the multiplicity of an entry in a list > a = ['abc','def','abc','ghij'] That's a Python question, not a NumPy question. So comp.lang.python would be a better forum. But here's a simplest solution:: a = ['abc','def','abc','ghij'] for it

[Numpy-discussion] Multiplicity of an entry

2009-10-26 Thread Nils Wagner
Hi all, how can I obtain the multiplicity of an entry in a list a = ['abc','def','abc','ghij'] The multiplicity of 'abc' is 2. 'def' is 1. 'ghij' is 1. Nils ___ NumPy-Discussion mailing list N