hahastephanie 2020-06-13 09:59 采纳率: 0%
浏览 1011
已采纳

急!python运行后什么都不输出

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]

运行结果什么都没有输出,为什么呢?求大佬解答!!

  • 写回答

1条回答 默认 最新

  • threenewbee 2020-06-13 10:01
    关注

    df1 = pd.read_sql_query(sql1, con=engine, index_col=None,
    coerce_float=True, params=None, parse_dates=None,chunksize=None)
    下面加上
    print(df1)
    看看

    再有,检查下数据库里面colors表有没有数据

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器