Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas split dataframe into chunks with a condition

import numpy as np

np.split(df, *np.where(df['column'] == condition))
 
PREVIOUS NEXT
Tagged: #pandas #split #dataframe #chunks #condition
ADD COMMENT
Topic
Name
7+8 =