Skip to content

Instantly share code, notes, and snippets.

@mueslo
Created August 8, 2014 19:26
Show Gist options
  • Save mueslo/0dc06a55873fcca4fb31 to your computer and use it in GitHub Desktop.
Save mueslo/0dc06a55873fcca4fb31 to your computer and use it in GitHub Desktop.
chooseallmin
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