[issue25478] Consider adding a normalize() method to collections.Counter()

2020-12-20 Thread Allen Downey
Allen Downey added the comment: This API would work well for my use cases. And looking back at previous comments in this thread, I think this proposal avoids the most objectionable pitfalls. -- nosy: +AllenDowney ___ Python tracker <ht

[issue25478] Consider adding a normalize() method to collections.Counter()

2018-05-17 Thread Allen Downey
Allen Downey <allendow...@gmail.com> added the comment: I'd like to second Raymond's suggestion. With just a few additional methods, you could support a useful set of operations. One possible API: def scaled(self, factor) """Returns a new Counter with all values multipli