import matplotlib.mlab as mlab
regions = mlab.contiguous_regions(ser_orig == manual_mode)
for i, (start, end) in enumerate(regions):
    ser_orig[start:end] = new_manual_mode_text.format(i)
Finding contiguous, non-unique slices in Pandas series without iterating