Check out example codes for "python mysql query to dataframe". It will help you in understanding the concepts better.

Code Example 1

from sqlalchemy import create_engine
import pymysql

db_connection_str = 'mysql+pymysql://mysql_user:[email protected]_host/mysql_db'
db_connection = create_engine(db_connection_str)

df = pd.read_sql('SELECT * FROM table_name', con=db_connection)

# This works with "mysql.connector" as well

Learn ReactJs, React Native from akashmittal.com