I have a dataframe with two columns that represent coordinates and an additional column in a boolean format:
X Y PROB
2 4 False
3 5 False
3 2 False
4 4 True
3 7 True
2 4 False
2 3 False
What I'm trying to do is to select consecutive False and True coordinates and produce 2 new dataframes as follows:
in the case of False
X Y PROB
2 4 1
3 5 1
3 2 1
2 4 2
2 3 2
in the case of True
X Y PROB
4 4 1
3 7 1
Right now my approach is using .isin but I get KeyError, some ideas?