DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
7+8 =
Submit