In [2]: min(data, key = lambda t: t[1])
Out[2]: (5, 0.01)
or:
In [3]: import operator
In [4]: min(data, key=operator.itemgetter(1))
Out[4]: (5, 0.01)
More Related Contents:
- how to unpack a tuple in this form (‘abc’, [20, 20])? [closed]
- What’s the difference between lists and tuples?
- How does tuple comparison work in Python?
- Why can’t I use a list as a dict key in python?
- How does swapping of members in tuples (a,b)=(b,a) work internally?
- Getting the index of the returned max or min item using max()/min() on a list
- Why can tuples contain mutable items?
- List vs tuple, when to use each? [duplicate]
- Get the key corresponding to the minimum value within a dictionary
- How to change values in a tuple?
- When are parentheses required around a tuple?
- Add Variables to Tuple
- Python convert tuple to string
- Getting one value from a tuple
- Accessing a value in a tuple that is in a list
- How to convert a list to a list of tuples?
- How does Python’s comma operator work during assignment?
- Tuple or list when using ‘in’ in an ‘if’ clause?
- Why is tuple faster than list in Python?
- Sorting a tuple that contains tuples
- JSON serialize a dictionary with tuples as key
- What’s the difference between lists enclosed by square brackets and parentheses in Python?
- Convert a columns of string to list in pandas
- lambda arguments unpack error
- Python Class __div__ issue
- Does Python have an immutable list?
- Swap values in a tuple/list inside a list in python?
- How to use ast.literal_eval in a pandas dataframe and handle exceptions
- If in Python I put a list inside a tuple, can I safely change the contents of that list? [duplicate]
- python tuple is immutable – so why can I add elements to it