I have a df:
import pandas as pd import numpy as np df = pd.DataFrame({ \'a\': [1, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 7, 8], })