I have a Polars DataFrame which has a column containing a variable length list of numbers in each row. For each row I need to drop consecutive duplicates from the list.
So for example:
[5, 5, 5, 4, 4, 5, 5, 6, 6, 7] => [5, 4, 5, 6, 7]
[3, 4, 4, 5, 6] => [3, 4, 5, 6]
[2, 2] => [2]
[1] => [1]
What is the fastest and most performant way to do this in Polars?