My Data set is mixed having lists and lists of lists. So I need to get unique objects from the lists or lists of lists but couldn't find any success. Input data set is as follows:
[[1, 2, 39], [1, 2, 39], [3], [[3], [4, 14, 63, 65], [66, 68, 82, 94]], [[5, 8, 31, 34], [36, 37, 42, 44], [55]], [6, 91], [[7, 35, 60, 71], [73, 83, 95, 98]], [[5, 8, 31, 34], [36, 37, 42, 44], [55]], [9, 72], [[10, 22, 30, 32], [38, 51, 56, 87], [89, 92]], [11], [12], [13, 90], [[4, 14, 63, 65], [66, 68, 82, 94]]]
Output Required:
[[1, 2, 39], [3], [4, 14, 63, 65], [66, 68, 82, 94], [5, 8, 31, 34], [36, 37, 42, 44], [55], [6, 91], [7, 35, 60, 71], [73, 83, 95, 98], [9, 72], [10, 22, 30, 32], [38, 51, 56, 87], [89, 92], [11], [12], [13, 90], [66, 68, 82, 94]]
abc=[]
for x in pool:
if x not in abc:
abc.append(x)
I am not getting that how can I choose distinct object of the list consisting of lists and lists of lists. Any help will be appreciated.
I have consulted multiple sources but nothing solves my problem. Few of them are as follows:
https://www.geeksforgeeks.org/python-get-unique-values-list/