import pandas as pd
from sqlalchemy import create_engine
connect_info = "mysql+mysqlconnector://root:passwd@localhost:3306/inventory?charset=utf8mb4"
auth_plugin='mysql_native_password'
engine = create_engine(connect_info) #use sqlalchemy to build link-engine
sql1 = "select * from colors" #SQL query
df1 = pd.read_sql_query(sql1, con=engine, index_col=None,
coerce_float=True, params=None, parse_dates=None,chunksize=None)
# #df = pd.read_sql(sql=sql,con=engine) #read data to DataFrame 'df'
#
# #显示所有列
pd.set_option('display.max_columns',10)
# #显示所有行
pd.set_option('display.max_rows', 10)
#
# # get the number of missing data points per column
missing_values_count = df1.isnull().sum()
#
# # look at the # of missing points in the first ten columns
missing_values_count[0:10]
运行结果什么都没有输出,为什么呢?求大佬解答!!