Re: Comparing values of counter in python 3.3

2013-12-16 Thread Devin Jeanpierre
On Sun, Dec 15, 2013 at 6:32 PM, rusi 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 C

Re: Comparing values of counter in python 3.3

2013-12-16 Thread Mark Lawrence
On 16/12/2013 02:40, Roy Smith wrote: In article <905d6e7e-6748-42dd-8b63-d80a4d175...@googlegroups.com>, rusi 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

Re: Comparing values of counter in python 3.3

2013-12-15 Thread rusi
On Monday, December 16, 2013 8:10:57 AM UTC+5:30, Roy Smith wrote: > rusi 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 cur

Re: Comparing values of counter in python 3.3

2013-12-15 Thread Roy Smith
In article <905d6e7e-6748-42dd-8b63-d80a4d175...@googlegroups.com>, rusi 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 ke

Re: Comparing values of counter in python 3.3

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 1:32 PM, rusi wrote: > 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. Which is why we have this list. Question: Is there a way to do x, y, and z, in Python? Answer: Chec

Re: Comparing values of counter in python 3.3

2013-12-15 Thread rusi
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 - Count

Re: Comparing values of counter in python 3.3

2013-12-15 Thread alex23
On 12/12/2013 5:49 PM, Amjad Syed wrote: Hello, I have 2 counters generated from list using Collections.counter() I want to print only key,values in Counter2 which have values > then corresponding value in Counter1. E.g Counter1={97:1,99:2,196:2,198:1} Counter2={97:1 ,99:3, 196:1,198:1} # O

Re: Comparing values of counter in python 3.3

2013-12-12 Thread Mark Lawrence
On 12/12/2013 09:55, Wolfgang Maier wrote: I want to print only key,values in Counter2 which have values > then corresponding value in Counter1. E.g Counter1={97:1,99:2,196:2,198:1} Counter2={97:1 ,99:3, 196:1,198:1} # Output [99,3] Try: [[key, Counter2[key]] for key in Counter1 if Counter2

Re: Comparing values of counter in python 3.3

2013-12-12 Thread Wolfgang Maier
> I want to print only key,values in Counter2 which have values > then > corresponding value in Counter1. > E.g > Counter1={97:1,99:2,196:2,198:1} > Counter2={97:1 ,99:3, 196:1,198:1} > > # Output > [99,3] > Try: [[key, Counter2[key]] for key in Counter1 if Counter2[key] > Counter1[key]] for a

Comparing values of counter in python 3.3

2013-12-11 Thread Amjad Syed
Hello, I have 2 counters generated from list using Collections.counter() I want to print only key,values in Counter2 which have values > then corresponding value in Counter1. E.g Counter1={97:1,99:2,196:2,198:1} Counter2={97:1 ,99:3, 196:1,198:1} # Output [99,3] # Need to compare values of co