Message180217
Hi there @serhiy.storchaka,
Consider the case where one would calculate the k-combination of set S. When the set has `n` elements, the number of k-combination is equal to its binomial coefficient. e.g. ( n!/( (k!(n-k)! ).
One method of statistically optimising the computation is to remove n least common elements from the set S.
I do agree that this new method is merely for consistency because right now it is quite easy to simply do c.most_common(...)[:-(n+1):-1] to get th e least common elements.
The goal of this patch is to make it intuitive to get the least common elements of a Counter, therefore making it easy to remove them from a collection.
Does it make any sense to you? |
|
Date |
User |
Action |
Args |
2013-01-18 19:54:49 | davidcoallier | set | recipients:
+ davidcoallier, rhettinger, ezio.melotti, serhiy.storchaka |
2013-01-18 19:54:49 | davidcoallier | set | messageid: <1358538889.85.0.672650416025.issue16994@psf.upfronthosting.co.za> |
2013-01-18 19:54:49 | davidcoallier | link | issue16994 messages |
2013-01-18 19:54:49 | davidcoallier | create | |
|