Splitting Pandas Dataframe based on row difference /u/brian890 Python Education

Forgive the poor title.

am working on a small program and need some guidance.

Basically I am trying to read a CSV, put the attributes into a data frame and filter where “video = 1”. This has been done.

What I cant figure out to do is splitting this data frame into multiple data frames. In the image below, I am looking to split it into two data frames when either the “count” is greater than 1, or the “Time” is greater than 100. Basically these are different recordings in the same log I need to split apart for analysis.

It might not happen in each log, it could happen 2+ times. I am thinking of a For Loop to determine if the previous row is greater than the values I mentioned above, but I cant figure out making it work.

https://imgur.com/a/WNpukCc

Any help is appreciated.

submitted by /u/brian890
[link] [comments]

​r/learnpython Forgive the poor title. am working on a small program and need some guidance. Basically I am trying to read a CSV, put the attributes into a data frame and filter where “video = 1”. This has been done. What I cant figure out to do is splitting this data frame into multiple data frames. In the image below, I am looking to split it into two data frames when either the “count” is greater than 1, or the “Time” is greater than 100. Basically these are different recordings in the same log I need to split apart for analysis. It might not happen in each log, it could happen 2+ times. I am thinking of a For Loop to determine if the previous row is greater than the values I mentioned above, but I cant figure out making it work. https://imgur.com/a/WNpukCc Any help is appreciated. submitted by /u/brian890 [link] [comments] 

Forgive the poor title.

am working on a small program and need some guidance.

Basically I am trying to read a CSV, put the attributes into a data frame and filter where “video = 1”. This has been done.

What I cant figure out to do is splitting this data frame into multiple data frames. In the image below, I am looking to split it into two data frames when either the “count” is greater than 1, or the “Time” is greater than 100. Basically these are different recordings in the same log I need to split apart for analysis.

It might not happen in each log, it could happen 2+ times. I am thinking of a For Loop to determine if the previous row is greater than the values I mentioned above, but I cant figure out making it work.

https://imgur.com/a/WNpukCc

Any help is appreciated.

submitted by /u/brian890
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *