I am attempting to create 3 dataframes, and name them after the 2nd element of each list.
In my actual project, there are 10+ dataframes, and the number could vary.
I don't know how to structure the return statement in the function. I also believe that when I state x[1] = pd.DataFrame(), I am inadvertently attempting to change the list value, whereas my intention is to use the list value as the df name itself.
import pandas as pd
names = [
['SPtab', 'sp', 'man'],
['SBtab', 'sb', 'man'],
['SDtab', 'sd', 'man']
]
def create_dfs():
for x in names:
x[1] = pd.DataFrame()
return
print(sp)
print(sb)
print(sd)