I have the following dataset, which is a series of rows stored as nested lists:
[['John', '35', 'UK'],
['Emma', '43', 'UK'],
['Lucy', '25', 'AU']]
(rows are always the same length)
I need to return 'UK', 'AU'
as an iterable (indifferent to ordering).
Is there a one-liner that returns the unique values contained in the third column, and which is simpler than this?
set(list(map(list, zip(*l)))[2])
(Ref: Transpose list of lists)