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:
>>>
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'],
>>
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
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,
@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
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
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'])
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
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