无类型对象没有属性“ tosql”
df.to_sql('newcmc', con = engine, if_exists='append',index = False)
运行上述代码时,它显示无类型对象没有属性“ to_sql”
df.to_sql('newcmc', con = engine, if_exists='append',index = False)
While running the above code it is showing None type object has no attribute "to_sql"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如所有评论(正确地)所断言的那样。变量
df
为none
。特别是,它来自
df=df.to_excel("newcmc.xlsx",index=None)
,它给出了None
。这会起作用:
As all of the comments are (correctly) asserting. The variable
df
isnone
.And in particular, this comes from
df=df.to_excel("newcmc.xlsx",index=None)
which is giving aNone
.this would work: