I know the built-in function np.unique() for removing all item duplicated in an array list in python, or convert the array list in a dict and to an array list.
But, the problem I have is the following:
I have for example 3 lists:
l1 = ['a', 'b', 'c', 'd', 'e', 'f', 'a', 'j', 'a'] l2 = ['b', 'a', 'b', 'd', 'e', 'f', 'b', 'j', 'b'] l3 = ['c', 'a', 'a', 'd', 'e', 'f', 'c', 'j', 'c']
I would like to know if it exists a built-in function to remove duplicates "a, b, c" a in list l1 b in list l2 c in list l3 and "a, b, c" are in same index in the example, it should remove items at index 8 and 6 on the 3 lists.
thanks with your help.
I would like to know if it exists a built-in function to remove duplicates "a, b, c" a in list l1 b in list l2 c in list l3 and "a, b, c" are in same index in the example, it should remove items at index 8 and 6 on the 3 lists.
thanks with your help.
If I understand your question correctly, each list while having different unique values, would return the same
unique_indicesandunique_countswhen runningnp.uniqueon each list. We can leverage this by only runningnp.uniqueon one list withreturn_countsandreturn_indexset toTrue, and then use its output.