微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

熊猫已弃用警告to_dict

如何解决熊猫已弃用警告to_dict

我收到此已弃用的警告:

Error: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

使用以下任何一条线时:

Using short name for 'orient' is deprecated. Only the options: ('dict',list,'series','split','records','index') will be used in a future version. Use one of the above to silence this warning.

pandas v1.1.3 python v3.7.1

解决方法

警告说“ orient”已被弃用。像这样使用它:

df.to_dict('records')

不要直接使用orient='',而要使用('dict',list,'series','split','records','index'),例如:

df.to_dict('dict')

df.to_dict('list')

,

我对同一警告感到困惑。后来我发现我使用“记录”而不是“记录”。无论如何,您都可以在警告之前1485附近的行中,在文件“ pandas / core / frame.py”中插入print(orient)行。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。