human
Finding consecutive segments in a pandas data frame
assistant
Here is some code to find consecutive segments from a column 'A' in a pandas data frame 'df'

df.reset_index().groupby('A')['index'].apply(np.array)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.