I have some list of data, for example
some_data = [1, 2, 4, 1, 6, 23, 3, 56, 6, 2, 3, 5, 6, 32, 2, 12, 5, 3, 2]
and i want to get unique va
You could try a simple set comprehension:
some_data = [1, 2, 4, 1, 6, 23, 3, 56, 6, 2, 3, 5, 6, 32, 2, 12, 5, 3, 2] n = {x for i, x in enumerate(set(some_data)) if i < 5} print n
Output:
set([32, 1, 2, 3, 4])