Hey guys, I've known about the Counter class for some time, and did my usual playing around with it when it first came out.
Yesterday I created a player of the Pig Dice Game and needed to create statistics on what strategy had won. I hit on the idea of sending the result in order of the winning strategy of each game played to an instance of the Counter class. A subsequent call of winners.most_common(), (at the end of the prog), collated the statistics I needed.
Today, at work, I was generating a more involved set of stats and I used counter.most_common in a similar way. These calls save me a lot of code which I appreciate, so I'd just like to thank you in a more public fashion.
Cheers people :-)
Mainly Tech projects on Python and Electronic Design Automation.
Tuesday, September 18, 2012
- ► 2013 (14)
- ▼ 2012 (12)
- ► 2010 (12)
- ► 2009 (42)
- ► 2008 (28)
- ► 2007 (23)