I have data frame as photo and I did for loop as
for n in datafram[datafram['logic'] == 1].groupby((datafram['logic'] != 1).cumsum()):
print(n)
and the result:
(68, points=>90% points<90% logic
time
2000-07-08 57.246744 42.753256 1
2000-07-09 52.494504 47.505496 1)
(73, points=>90% points<90% logic
time
2000-07-15 52.545239 47.454761 1
2000-07-16 50.093015 49.906985 1
2000-07-17 50.465077 49.534923 1)
(86, points=>90% points<90% logic
time
2000-07-31 53.847455 46.152545 1
2000-08-01 56.434974 43.565026 1
2000-08-02 56.942330 43.057670 1)
how do this result as pandas data frame as:
time points=>90% points<90% logic
2000-07-08 57.246744 42.753256 1
2000-07-09 52.494504 47.505496 1
2000-07-15 52.545239 47.454761 1
2000-07-16 50.093015 49.906985 1
2000-07-17 50.465077 49.534923 1)
2000-07-31 53.847455 46.152545 1
2000-08-01 56.434974 43.565026 1
2000-08-02 56.942330 43.057670 1