For the following code:
Extract article details and append to the DataFrame
for article in articles['articles']:
date = pd.to_datetime(article['publishedAt'])
title = article['title']
articles = article['description']
link = article['url']
article_info = article_info.append({'Date': date, 'Title': title,
'Articles': articles, 'Link': link}, ignore_index=True)
Getting two errors:
1. KeyError: 'description' 2.
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /var/folders/zl/spmtrdq13t55wjzv3ggg6m600000gn/T/ipykernel_41032/692999486.py in ?() 4 title = article['title'] 5 #articles = article['description'] 6 link = article['url'] 7 ----> 8 article_info = article_info.append({'Date': date, 'Title': title, 9 'Articles': articles, 'Link': link}, ignore_index=True) ~/anaconda3/lib/python3.11/site-packages/pandas/core/generic.py in ?(self, name) 5985 and name not in self._accessors 5986 and self._info_axis._can_hold_identifiers_and_holds_name(name) 5987 ): 5988 return self[name] -> 5989 return object.__getattribute__(self, name) AttributeError: 'DataFrame' object has no attribute 'append'
Please could you help me fix this? the code is copied exactly as per the course notebook.