Comparing values of counter in python 3.3
breamoreboy at yahoo.co.uk
Mon Dec 16 10:20:42 CET 2013
On 16/12/2013 02:40, Roy Smith wrote:
> In article <905d6e7e-6748-42dd-8b63-d80a4d175914 at googlegroups.com>,
> rusi <rustompmody at gmail.com> wrote:
>> On Monday, December 16, 2013 7:29:31 AM UTC+5:30, alex23 wrote:
>>>> # Need to compare values of counter and reject in function/routine in
>>>> value in counter2 is higher then value in counter1 for a current key
>>> [(k,Counter2[k]) for k in Counter2 - Counter1]
>> Why not just?
>> Counter2 - Counter1
>> And if you want to uncounterify it then
>> dict(Counter2 - Counter1)
>>> Counters are awesome.
>> Yes -- agreed. But 'counter' is a strange name -- after checking whether
>> 'bag' and 'multiset' are there in the library, I would not think to
>> check anything else.
> Bag and multiset are names only CS weenies would think to look for.
> Counter is the name for the rest of us :-)
Give me bag or multiset any day of the week, it's blatantly obvious what
they do. Counter, what the heck? :)
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
More information about the Python-list