Last active
December 20, 2015 19:49
-
-
Save ryonsherman/ab557853e3a7de24a024 to your computer and use it in GitHub Desktop.
Sort numerical values regardless of format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
numsort = lambda l: sorted(l, key=lambda x: int(str(x).split('-')[0].split('.')[0].replace('$', ''))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example