pandas 读取json ValueError:协议未知 [英] Pandas read json ValueError: Protocol not known

查看:68
本文介绍了 pandas 读取json ValueError:协议未知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不久前运行了这些代码并且它起作用了,但现在有一个 ValueError: 协议未知.任何人都可以帮忙.谢谢.

I ran these codes a while ago and it worked but now there is a ValueError: protocol not known. Could anyone help. Thanks.

import json
temp = json.dumps([status._json for status in tweet]) #create JSON
newdf = pd.read_json(temp, orient='records')

推荐答案

据我所知,这个问题是由 pandas 的更新引起的.1.1.0 更新对 read_json 函数进行了一些更改.

As far as I could debug this issue is caused by an update of pandas. The 1.1.0 update had changed few things on the read_json function.

我可以在将 pandas 版本设置为 1.0.5 时使我的代码工作

I could make my code work when setting pandas version to 1.0.5

https://pandas.pydata.org/docs/whatsnew/v1.1.0.html

这篇关于 pandas 读取json ValueError:协议未知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆