Message180238
> One method of statistically optimising the computation is to remove n least common elements from the set S.
May be you need not remove least common elements from the set, but *get* a set of (len(S)-n) most common elements?
> Does it make any sense to you?
Frankly, not very much.
Note, that least common element is not defined in most cases. Usually there are only a few most (or even one) common elements, but a lot of least common elements. Result of least_common(n) is practically random due to hash randomization.
Another note is that most_common()[:-n] in many cases faster than least_common(n) for n >> 1. This is right for most_common(n) too, but it usually used for very small n (in particular for n=1) and this has more sense. |
|
Date |
User |
Action |
Args |
2013-01-19 09:49:49 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, ezio.melotti, davidcoallier |
2013-01-19 09:49:49 | serhiy.storchaka | set | messageid: <1358588989.9.0.770895767358.issue16994@psf.upfronthosting.co.za> |
2013-01-19 09:49:49 | serhiy.storchaka | link | issue16994 messages |
2013-01-19 09:49:49 | serhiy.storchaka | create | |
|