I have a pandas data frame that contains 38 time series. Each time series starts at 0s and finishes at 1s, and a numerical column with the time in seconds between 0 and 1 is the only hint I have about where each time series starts and where it ends.
I would like to split the original df int 38 data frames.
I guess I could simply loop over the rows and perform checks until the value reaches 1s and then split, but I was wondering if there's a smarter and fastest way of doing this? At some point I will have 38.000 time series...
The dataframe would look something like:
rows ¦ var1 ¦ var2 ¦... ¦ time
row 1 ¦ x ¦ y ¦ ... ¦ 0.0
.
row 100 ¦ x100 ¦ y100 ¦ ... ¦ 1.0
row 101 ¦ x101 ¦ y101 ¦ ... ¦ 0.0
.
I would like to split the df in the row 100, such that row 101 is the first row of a new different dataframe. And I would repeat this procedure 38 times within a given df.
My question is not the same as [1], because in that case the person wants to group by same date values, and in my case I don't want to group by same values.