Serhiy Storchaka added the comment: > 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16994> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com