How to create a new table in a MySQL DB from a pandas dataframe
I recently transitioned from using SQLite for most of my data storage and management needs to MySQL. I think I've finally gotten the correct libraries installed to work with Python 3.6, but now I am having trouble creating a new table from a dataframe in the MySQL database. Here are the libraries I import: import pandas as pd import mysql.connector from sqlalchemy import create_engine In my code, I first create a dataframe from a CSV file (no issues here). def csv_to_df(infile): return pd.read_csv(infile) Then I establish a connection to the MySQL database using this def function: def mysql