On 17 Aug, 02:29, Raymond Hettinger pyt...@rcn.com 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
On Aug 17, 10:47 pm, Paddy paddy3...@googlemail.com wrote:
On 17 Aug, 02:29, Raymond Hettinger pyt...@rcn.com 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:
On Aug 17, 2:29 am, Raymond Hettinger pyt...@rcn.com 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.
On 14 Aug, 18:14, Raymond Hettinger pyt...@rcn.com wrote:
On Aug 12, 1:20 pm, Paddy paddy3...@googlemail.com 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.
[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 a
On Aug 12, 1:20 pm, Paddy paddy3...@googlemail.com 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
On Thu, Aug 12, 2010 at 10:36 PM, Steven D'Aprano
st...@remove-this-cybersource.com.au 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
On Aug 13, 6:36 am, Steven D'Aprano st...@remove-this-
cybersource.com.au 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
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. I know how to
calculate it:
b = Counter(a=1, b=2)
c = Counter(a=3, b=1)
diff = (b - c) + (c - b)
(b - c)
Counter({'b': 1})
(c
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
people
10 matches
Mail list logo