Skip to content

Instantly share code, notes, and snippets.

@attibalazs
Last active April 29, 2016 08:52
Show Gist options
  • Save attibalazs/f87d2a715113a2eb2804d18d7ee3809a to your computer and use it in GitHub Desktop.
Save attibalazs/f87d2a715113a2eb2804d18d7ee3809a to your computer and use it in GitHub Desktop.
# how can i exclude None values ?
#get minimum and maximum stock options
result = min(data_dict.values(), key=lambda v:v['exercised_stock_options'] if v['exercised_stock_options'] != 'NaN' else float('inf'))
print result
result = max(data_dict.values(), key=lambda v:v['exercised_stock_options'] if v['exercised_stock_options'] != 'NaN' else float('-inf'))
print result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment