split pandas columns into two code example
Example 1: pandas split column into multiple columns by delimiter
df[['A', 'B']] = df['AB'].str.split(' ', 1, expand=True)
Example 2: split pandas dataframe in two
df_new1, df_new2 = df[:10, :], df[10:, :] if len(df) > 10 else df, None