Skip to content

Instantly share code, notes, and snippets.

@naphthalene
Last active November 17, 2016 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naphthalene/0e6c4d1e0427eb93634d9178ee71608e to your computer and use it in GitHub Desktop.
Save naphthalene/0e6c4d1e0427eb93634d9178ee71608e to your computer and use it in GitHub Desktop.
This software is provided without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Free for commercial use, please report projects in the forum at http://www.bulletphysics.org
In case you want to display a Bullet logo in your software: you can download the Bullet logo in various vector formats and high resolution at the download section in http://bullet.googlecode.com
import operator
from collections import Counter
with open('some_file.txt') as f:
print '\n'.join(zip(*sorted(Counter(f.read().split()).iteritems(), key=operator.itemgetter(1, 0), reverse=True))[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment