I am using a dictionary to pull data and using a for loop to store iterate through each item and storing it as a unique key:
df_dict = {}
key_name = {"item1": "url",
"item2": "url",
"item3": "url"
}
for key,value in key_name.items():
temp_df = spy.search(str(value), quiet=True)
df_dict["{0}".format(key)] = spy.pull(temp_df, start=start_date, end=end_date, header='Name', grid=None)
The spy.search and spy.pull are functions related to Seeq Data Labs but I don't believe to be related to the problem.
This creates a dictionary that looks like:
{'item1': [9226 rows x 19 columns],
'item2': [5 rows x 8 columns],
'item3': [8300 rows x 33 columns]}
I want to store each key as the name of a new data frame named 'item1' that has all of the values stored as a data frame
Any help would greatly be appreciated! Thank you!