pygsti.tools.listtools.remove_duplicates#
- remove_duplicates(l, index_to_test=None)#
Remove duplicates from the a list and return the result.
- Parameters:
l (iterable) – The list/set to remove duplicates from.
index_to_test (int, optional) – If not None, the index within the elements of l to test. For example, if all the elements of l contain 2 tuples (x,y) then set index_to_test == 1 to remove tuples with duplicate y-values.
- Returns:
the list after duplicates have been removed.
- Return type:
list