Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

split pandas dataframe in two

df_new1, df_new2 = df[:10, :], df[10:, :] if len(df) > 10 else df, None
 
PREVIOUS NEXT
Tagged: #split #pandas #dataframe
ADD COMMENT
Topic
Name
1+2 =