Append does not work on dictionary object. My code is as follow:
with open (file) as f:
for line in f:
review = json.loads(line)
review.append((review['reviewText'],review['overall']))#append is not working
review[5]
Append does not work on dictionary object. My code is as follow:
with open (file) as f:
for line in f:
review = json.loads(line)
review.append((review['reviewText'],review['overall']))#append is not working
review[5]
The dictionary object has no append
method. You can add key,value to a dictionary such as follow:
review["you_key"] = your_value