Created
August 8, 2014 19:26
-
-
Save mueslo/0dc06a55873fcca4fb31 to your computer and use it in GitHub Desktop.
chooseallmin
This file contains 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
def chooseallmin(x,f): | |
if len(x)==0: return x | |
vals = map(f, x) | |
minval = min(vals) | |
return [x[i] for i,e in enumerate(vals) if e==minval] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment