pandas读mysql数据库做EDA(探索性数据分析)
import pandas as pd
from pandas_profiling import ProfileReport
import pymysql
con='mysql+pymysql://root:1234@127.0.0.1:3306/employees'
sql = 'select * from dept_emp'
pdata = pd.read_sql(sql,con,index_col=None,coerce_float=True,params=None,parse_dates=None,columns=None,chunksize=None)
#EDA using pandas-profiling
profile = ProfileReport(pdata, explorative=True)
#Saving results to a HTML file
profile.to_file("output.html")