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')
The solution in my case consisted in using StringIO
as below:
from io import StringIO
newdf = pd.read_json(StringIO(temp))
Looks like pd.read_json
in Pandas 1.1 is no more accepting simple string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With