我已将SQLite中的几个表导出到字典中。有没有办法提取现在在字典中的所有数据帧并为每个数据帧创建一个数据帧? (例如df1,df2,df3等......)
conn = sq3.connect('C:/Users/database.db')
cur = conn.cursor()
cur.execute("SELECT name FROM sqlite_master WHERE type='table';")
tablenames = cur.fetchall()
df_dict = {}
for tablename in tablenames:
tablename = tablename[0]
df_dict[tablename] = pd.read_sql_query('SELECT * FROM %s' % tablename, conn).set_index('date')