I have a dataframe like given bellow
date,value
2/10/19,34
2/11/19,34
2/12/19,34
2/13/19,34
2/14/19,34
2/15/19,34
2/16/19,34
2/17/19,0
2/18/19,0
2/19/19,0
2/20/19,22
2/21/19,22
2/22/19,22
2/23/19,22
2/24/19,0
2/25/19,0
2/26/19,0
2/27/19,0
2/28/19,1
3/1/19,2
3/2/19,2
3/3/19,1
3/4/19,0
3/5/19,0
3/6/19,0
3/7/19,3
3/8/19,3
3/9/19,3
3/10/19,0
After every interval dataframe has zero values, I want to group rows in such a way that if zero appears more two times continuously it should create a sub dataframe and save a file.
Output:
df1
2/17/19,0
2/18/19,0
2/19/19,0
df2
2/24/19,0
2/25/19,0
2/26/19,0
2/27/19,0
df3
3/4/19,0
3/5/19,0
3/6/19,0
I tried many ways to do it but it fails.
Thank you.