[issue16994] collections.Counter.least_common

2017-10-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thank you for the suggestion, but I'm going to mark it as rejected for the reasons listed in the other posts. -- resolution: -> rejected stage: patch review -> resolved status: pending -> closed ___ Python track

[issue16994] collections.Counter.least_common

2017-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This proposition was discussed also on Python-Ideas (https://mail.python.org/pipermail/python-ideas/2017-March/045215.html). I think it should be rejected. In general this doesn't make sense. In rare cases when you want to to get the least common items in t

[issue16994] collections.Counter.least_common

2013-01-19 Thread Serhiy Storchaka
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 yo

[issue16994] collections.Counter.least_common

2013-01-18 Thread David Coallier
Changes by David Coallier : Added file: http://bugs.python.org/file28774/16994.patch ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue16994] collections.Counter.least_common

2013-01-18 Thread David Coallier
David Coallier added the comment: 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 optimisi

[issue16994] collections.Counter.least_common

2013-01-18 Thread David Coallier
Changes by David Coallier : Removed file: http://bugs.python.org/file28773/collections.Counter.least_common.patch ___ Python tracker ___ ___

[issue16994] collections.Counter.least_common

2013-01-18 Thread David Coallier
David Coallier added the comment: Latest patch after code review round #1 -- Added file: http://bugs.python.org/file28773/collections.Counter.least_common.patch ___ Python tracker _

[issue16994] collections.Counter.least_common

2013-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is use case for this method? Actually, any element which is not in a collection, is a least common for this collection. -- nosy: +serhiy.storchaka ___ Python tracker __

[issue16994] collections.Counter.least_common

2013-01-18 Thread Ezio Melotti
Ezio Melotti added the comment: I left a review on Rietveld. Since this is a new feature it can't go on 2.7, and it should target 3.4 instead. -- nosy: +ezio.melotti stage: -> patch review versions: +Python 3.4 -Python 2.7 ___ Python tracker

[issue16994] collections.Counter.least_common

2013-01-18 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue16994] collections.Counter.least_common

2013-01-18 Thread David Coallier
New submission from David Coallier: The `collections.Counter` library contains very useful methods for playing with dicts and sets (mainly the most_common()) function. Even though it is fairly trivial to retrieve the least common elements in a Counter() by doing Counter(...).most_common(n)[:-n