I have a dataset organized into a dictionary of lists, like:
{ UUID: [3, 3, 5, 3, 0, 0, 3, 3, 2, 3, 2, 1, 1, 0, 2, 0, 5, 0, 0, 0, 0, 3, 4, 1, 2],
UUID: [1, 2, 3, 1, 0, 0, 2] }
I want to detect cases of consecutive identical values (esp. 0's), in particular detecting instances of n consecutive identical values.
For example, if n were 3 and the value was 0, I would append the UUID of the first key:value pair to a list of qualifying UUIDs, but not the second.
What's the most efficient way to detect consecutive identical values in this way?