On Aug 17, 2:29 am, Raymond Hettinger wrote:
> I would like to see someone post a subclass to the ASPN Cookbook that
> adds a number of interesting, though not common operations. Your
> symmetric_difference() method could be one. A dot_product() operation
> could be another. Elementwise arithm
On Aug 17, 10:47 pm, Paddy wrote:
> On 17 Aug, 02:29, Raymond Hettinger wrote:
>
>
>
> > [Paddy]
>
> > > Lets say you have two *sets* of integers representing two near-copies
> > > of some system, then a measure of their difference could be calculated
> > > as:
>
> > > len(X.symmetric_difference(
On 17 Aug, 02:29, Raymond Hettinger wrote:
> [Paddy]
>
> > Lets say you have two *sets* of integers representing two near-copies
> > of some system, then a measure of their difference could be calculated
> > as:
>
> > len(X.symmetric_difference(Y)) / (len(X) + len(Y)) * 100 %
>
> > If the two coll
[Paddy]
> Lets say you have two *sets* of integers representing two near-copies
> of some system, then a measure of their difference could be calculated
> as:
>
> len(X.symmetric_difference(Y)) / (len(X) + len(Y)) * 100 %
>
> If the two collections of integers are allowed duplicates then you
> need
On 14 Aug, 18:14, Raymond Hettinger wrote:
> On Aug 12, 1:20 pm, Paddy wrote:
>
> > I find myself needing to calculate the difference between two Counters
> > or multisets or bags.
>
> > I want those items that are unique to each bag.
>
> Tell us about your use cases. I'm curious how a program w
On Aug 12, 1:20 pm, Paddy wrote:
> I find myself needing to calculate the difference between two Counters
> or multisets or bags.
>
> I want those items that are unique to each bag.
Tell us about your use cases. I'm curious how a program would ascribe
semantic meaning to the result. The phrase
On Aug 13, 6:36 am, Steven D'Aprano wrote:
> On Thu, 12 Aug 2010 13:20:19 -0700, Paddy wrote:
> > I find myself needing to calculate the difference between two Counters
> > or multisets or bags.
>
> Is this collections.Counter from Python 3.1? If so, you should say so,
> and if not, you should tel
On Thu, Aug 12, 2010 at 10:36 PM, Steven D'Aprano
wrote:
> On Thu, 12 Aug 2010 13:20:19 -0700, Paddy wrote:
>
>> I find myself needing to calculate the difference between two Counters
>> or multisets or bags.
>
> Is this collections.Counter from Python 3.1?
"Changed in version **2.7**: Added Coun
On Thu, 12 Aug 2010 13:20:19 -0700, Paddy wrote:
> I find myself needing to calculate the difference between two Counters
> or multisets or bags.
Is this collections.Counter from Python 3.1? If so, you should say so,
and if not, you should tell us which Counter class this is. It will save
peopl