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