Create Remove Duplicates from Sorted Array II (pyemma)