Answers for "splitting a dataframe into 2 based on column"

1

how explode by using two columns pandas

df.set_index('col1').apply(pd.Series.explode).reset_index()
Posted by: Guest on August-17-2021
0

split pandas dataframe in two

df_new1, df_new2 = df[:10, :], df[10:, :] if len(df) > 10 else df, None
Posted by: Guest on November-26-2019

Code answers related to "splitting a dataframe into 2 based on column"

Python Answers by Framework

Browse Popular Code Answers by Language