Q. Write the steps required to read data from a MySQL database to a DataFrame.


Answer :-


import mysql.connector as a
db=a.connect(user='root',passwd='0000000000' ,host='localhost',database='h')
import pandas as pd
df=pd.read_sql(f'select * from table_name',db)
print(df)

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post