On 11/11/2022 12:49 PM, Dennis Lee Bieber wrote:
On Fri, 11 Nov 2022 02:22:34 -0500, DFS <nos...@dfs.com> declaimed the
following:
[(0,11), (1,1), (2,1),
(0,1) , (1,41), (2,2),
(0,9) , (1,3), (2,12)]
The set of values in elements[0] is {0,1,2}
I want the set of max values in elements[1]: {11,41,12}
Do they have to be IN THAT ORDER?
Yes.
data = [(0,11), (1,1), (2,1), (0,1) , (1,41), (2,2), (0,9) , (1,3), (2,12)]
reshape = list(zip(*data))
result = sorted(reshape[1])[-3:]
result
[11, 12, 41]
--
https://mail.python.org/mailman/listinfo/python-list