Why doesn't this work. And is there a way to doing this. I want to use the table names
and create a df for each table.
table1= pd.DataFrame()
table2= pd.DataFrame()
table3= pd.DataFrame()
table4= pd.DataFrame()
tables_name = ['table1', 'table2', 'table3', 'table4']
tables = [table1, table2, table3, table4]
for i, j in zip(tables_name, tables):
q = f"""
SELECT
*
FROM email.{i}
"""
crm = pd.read_sql_query(q, con=db)
j = crm.copy()
print(table1.head(3))