pythonpandas

Pandas read_json ValueError: Protocol not known


I ran the following code a while ago and it worked but now there is the following error. How to solve it?

ValueError: protocol not known.

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

Solution

  • 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.

    I could make my code work when setting Pandas version to 1.0.5.