I have a data frame of 100 rows that I am trying to split into multiple Dataframes as per the below code:
for m in df['month'].unique():
temp = 'df_{}'.format(m)
vars()[temp] = finance_metrics[df['month']==m]
This gives me 5 new Dataframes as below:
df_January
df_February
df_March
df_April
df_May
I am trying to have each of these 5 Dataframe inserted into a Google sheet which works well as per the code below. The issue I am having is I am trying to have each of these Dataframes inserted one below the other in the Google Sheet and I am having trouble trying to have the cell referenced accordingly. The below code inserted each Dataframe starting cell A4 and it so happens that the last Dataframe that is created in a loop using the above code overwrites all of the previously created Dataframe. I would like to avoid the Dataframes getting overwritten.
wks.set_dataframe(vars()[temp], 'A'+'4+len(vars()[temp])')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…