Best: min(d, key=d.get)
— no reason to interpose a useless lambda
indirection layer or extract items or keys!
>>> d = {320: 1, 321: 0, 322: 3}
>>> min(d, key=d.get)
321
More Related Contents:
- How to find the min/max value of a common key in a list of dicts?
- How to select random key with common values?
- How do I sort a dictionary by value?
- Split / Explode a column of dictionaries into separate columns with pandas
- How to “perfectly” override a dict?
- List of unique dictionaries
- How to properly subclass dict and override __getitem__ & __setitem__
- Creating a dictionary from a CSV file
- Nested dictionary to multiindex dataframe where dictionary keys are column labels
- Comparing Python dictionaries and nested dictionaries
- How to dump a dict to a JSON file?
- Python “extend” for a dictionary
- Python: Checking if a ‘Dictionary’ is empty doesn’t seem to work
- Find min, max, and average of a list
- Creating a list of dictionaries with same keys? [duplicate]
- Is there a ‘multimap’ implementation in Python?
- Subclassing dict: should dict.__init__() be called?
- Append a dictionary to a dictionary [duplicate]
- Why is a class __dict__ a mappingproxy?
- Python idiom to return first item or None
- How do you find the first key in a dictionary?
- Extract a subset of key-value pairs from dictionary?
- Global dictionaries don’t need keyword global to modify them? [duplicate]
- how to convert list of dict to dict
- convert csv file to list of dictionaries
- How to reverse a dictionary (whose values are lists) in Python? [duplicate]
- Why does CSV file contain a blank line in between each data line when outputting with Dictwriter in Python [duplicate]
- How do I re-map python dict keys
- How do I merge dictionaries together in Python?
- Python: Writing Nested Dictionary to CSV