Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

remove consecutive duplicates python

def remove_consecutive_duplicates(_list: list):
    preprocessed_list = []
    for x in itertools.groupby(_list):
        preprocessed_list.append(x[0])

    return preprocessed_list
 
PREVIOUS NEXT
Tagged: #remove #consecutive #duplicates #python
ADD COMMENT
Topic
Name
4+5 =