I have a pandas data frame I need to chunk up into ten smaller sub-sets and I am doing it as follows:
df_1, df_2, df_3, df_4, df_5, df_6, df_7, df_8, df_9, df_10 = np.array_split(processed_data, 10)
This is horrible. Is there a way of generating the variable names via an expression?
For example:
df[some expression to evaluate n] = np.array_split(processed_data, n)
I've tried various things and have not gotten anywhere. Any insight would be appreciated. Thanks!