find consecutive segments from a column 'a' in a pandas data frame 'df',df.reset_index().groupby('A')['index'].apply(np.array)