My code is :data_review=pd.read_json(\'review.json\')
I have the data review
as fllow:
{
// string, 22 character unique review id
If you don't want to use a for-loop, the following should do the trick:
import pandas as pd
df = pd.read_json("foo.json", lines=True)
This will handle the case where your json file looks similar to this:
{"foo": "bar"}
{"foo": "baz"}
{"foo": "qux"}
And will turn it into a DataFrame consisting of a single column, foo
, with three rows.
You can read more at Panda's docs