I have a dataframe with data like this:
datetime    my_value
2020-01-01   0
2020-01-02   0
2020-01-03   0
2020-01-04   1
2020-01-05   1
2020-01-06   2
2020-01-07   2
2020-01-08   2
2020-01-09   2
2020-01-10   3
2020-01-11   3
and I would like to find the time where each my_value group starts and stops
For example the '0' chunk starts at index 0 and ends at index 2, the '1' chunk starts at 3 and finished at index 4 (but I need the datetime data).
The datetime column is an index and each row is unique. The values in my_value are sequential ints that represent different areas, of various lengths, in my data. How can this be done with Pandas?
 
    