I'm web-scraping the data from a website, so I created a for loop to collect the data from multiple webpages and generate separate dataframes. However, I don't know how to save them with different names.
I first created the list of dataframe names:
dataframe_names=[]
for i in range(0,50):
text='item'+str(i)
dataframe_names.append(text)
I then included the following code in the loop that creates dataframes:
df=[name for name in dataframe_names]
The expected output is the dataframes created from for loop and saved all separately such as df1, df2,df3,.....df50.
However it didn't work. Could you help solve this issue?
for group, data in df.groupby(group_by_key):;data.to_csv(f"{group}.csv",index=False)better if you add a subset of your data - Umar.H