want to convert pandas dataframe to sql. I also want to get the .sql on my desktop with my sql table.
This is the code that I have:
import pandas as pd
from sqlalchemy import create_engine
df = pd.DataFrame({'second':[5,6,7,8,9],
'first':['ne', 'da', 'ne', 'da', 'da'],
'third':[213,151,16,641,64]})
print(df)
engine = create_engine('sqlite://', echo=False)
sample_sql_database = df.to_sql('sample_database', con=engine)
sample_sql_database = engine.execute("SELECT * FROM sample_database").fetchall()
print(sample_sql_database)
Im using to_sql , my code does not shows any errors, but I do not know how to get my table to appears on deskop