This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients davidcoallier, ezio.melotti, rhettinger, serhiy.storchaka
Date 2013-01-19.09:49:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1358588989.9.0.770895767358.issue16994@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2013-01-19 09:49:49serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, ezio.melotti, davidcoallier
2013-01-19 09:49:49serhiy.storchakasetmessageid: <1358588989.9.0.770895767358.issue16994@psf.upfronthosting.co.za>
2013-01-19 09:49:49serhiy.storchakalinkissue16994 messages
2013-01-19 09:49:49serhiy.storchakacreate