Last active
April 29, 2016 08:52
-
-
Save attibalazs/f87d2a715113a2eb2804d18d7ee3809a to your computer and use it in GitHub Desktop.
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
# 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
https://stackoverflow.com/questions/36933795/python-getting-min-max-values-from-nested-dictionary