I have a problem with segmenting a pd.DataFrame (or pd.Series) at a point the value switches.
For example, I have a data like
list('AAAAABBBBBAAABBBCCCCBBBBAAAAA')
as you can see, As and Bs and Cs are arranged in chunks.
What is the most pythonic way to manage them in to segments?
I believe the code will be produce a array-like data that is like:
list('00000111112223334445555666677777')
which is a list of the names for the segments.