-1

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]
jone
  • 1
  • 4
    Does this answer your question? ['dict' object has no attribute 'append' Json](https://stackoverflow.com/questions/33640689/dict-object-has-no-attribute-append-json) – Catarina Nogueira Jul 20 '20 at 08:25

1 Answers1

0

The dictionary object has no append method. You can add key,value to a dictionary such as follow:

review["you_key"] = your_value