Quantcast
Channel: splitting a pandas Dataframe - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Answer by jezrael for splitting a pandas Dataframe

If Finish value sometimes missing and need use only progressPercentage column use:shifted = df['progressPercentage'].shift()#compare difference for second 100 if together 100 (e.g. 15, 16 row) m =...

View Article


Answer by Carlo Allocca for splitting a pandas Dataframe

the best way I found is the following: a = dfb['progressPercentage'].shift().eq(100).cumsum() df_output = dfb.groupby([dfb.id_B,a]) for k, gp in aa: print('key='+ str(k))...

View Article


Answer by Bharath M Shetty for splitting a pandas Dataframe

You can divide the dataframe by progressPercentage which is equal 100. Remove the earlier index if they are consecutive.Then slice and append the dataframe to an array. Hope this helpsimport numpy as...

View Article

splitting a pandas Dataframe

I would like to filter and split my original dataframe into a number of dataframes using the condition that progressPercentage goes from 1.0 to 100 as in the following example:Input:id_B,...

View Article
Browsing latest articles
Browse All 4 View Live


Latest Images