I have this list
names = [ ["cat", 9112, "dog123", 5625], ["luck", 1232, "bad23"] ]
According to this question I have done it by using this code
names = [ ["cat", 9112, "dog123", 5625], ["luck", 1232, "bad23"] ]
new = [[x for x in y if isinstance(x, int)] for y in names]
Output -: [[9112, 5625], [1232]]
problem
Now I want to remove duplicate numbers like this.
expected output -: [[912, 562], [123]]
I was using this code but it wasn't working
m = sorted(list(set(new)))
print(m)
Error -:
Traceback (most recent call last):
File "main.py", line 13, in <module>
m = sorted(list(set(new)))
TypeError: unhashable type: 'list'
Note -: I want to keep only first original digits.(eg -: 1232 need to become 123 not 132)
remove_dups(x) for x in y if instance(x, int)