Photos
-
Tag Cloud
android awk bash bioservices books C CSS dictionary english fedora Firefox gimp git github graphviz HTML ipython latex Linux malloc matplotlib mount pandas PDF perl PHP pypi python R rest rpy rpy2 sed sphinx ssh svn video vim virtualbox virtualenv web services wget wordpress xbmc yum
WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.
Follow me
-
Recent Posts
calendar
April 2018 M T W T F S S « Mar 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Recent Comments
- Sophie on python argparse issues with the help argument (TypeError: %o format: a number is required, not dict)
- Anonymous on Installation of Python 2.6 error fixed
- Rhys on Installation of Python 2.6 error fixed
- Martty on latex: same footnote but different reference places (with hyperlink)
- Tim Turner on Thunderbird hangs forever when “Copying message to Sent folder”
Archives
- March 2018
- February 2018
- January 2018
- December 2017
- October 2017
- September 2017
- August 2017
- June 2017
- May 2017
- January 2017
- November 2016
- October 2016
- September 2016
- March 2016
- February 2016
- January 2016
- June 2015
- May 2015
- February 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- November 2013
- October 2013
- September 2013
- August 2013
- July 2013
- June 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- July 2012
- June 2012
- April 2012
- March 2012
- February 2012
- January 2012
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
Categories
Meta
Tag Archives: sorting
How to sort a dictionary by values in Python
Tweet By definition, dictionary are not sorted (to speed up access). Let us consider the following dictionary, which stores the age of several persons:
1 |
d = {"Pierre": 42, "Anne": 33, "Zoe": 24} |
If you want to sort this dictionary by values (i.e., the age), you must be … Continue reading