You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
could any one know how to resolve the issue of KyError about the parameter of 'response' in the command of "count_total_articles = count_total_articles +len(NYTimes_data["response"]["docs"][:])" please?
The follow is a full description of the error:
KeyError Traceback (most recent call last) in ()
4 with open(file_str) as data_file:
5 NYTimes_data = json.load(data_file)
----> 6 count_total_articles = count_total_articles + len(NYTimes_data["response"]["docs"][:]) #add article number
7 for i in range(len(NYTimes_data["response"]["docs"][:])): # search in every docs for type of material or section = in the list
8 try:
KeyError: 'response'
Best regards,
Francis
The text was updated successfully, but these errors were encountered:
Hi,
could any one know how to resolve the issue of KyError about the parameter of 'response' in the command of "count_total_articles = count_total_articles +len(NYTimes_data["response"]["docs"][:])" please?
The follow is a full description of the error:
KeyError Traceback (most recent call last)
in ()
4 with open(file_str) as data_file:
5 NYTimes_data = json.load(data_file)
----> 6 count_total_articles = count_total_articles + len(NYTimes_data["response"]["docs"][:]) #add article number
7 for i in range(len(NYTimes_data["response"]["docs"][:])): # search in every docs for type of material or section = in the list
8 try:
KeyError: 'response'
Best regards,
Francis
The text was updated successfully, but these errors were encountered: