我下面的代码生成以下错误:我做错了什么吗?
*KeyError Traceback (most recent call last)
<ipython-input-18-561c05f0fdd1> in <module>
----> 1 venues = results['response']['groups'][0]['items']
2
3 nearby_venues = json_normalize(venues) # flatten JSON
4
5 # filter columns
KeyError: 'groups'*
venues = results['response']['groups'][0]['items']
nearby_venues = json_normalize(venues) # flatten JSON
# filter columns
filtered_columns = ['venue.name', 'venue.categories', 'venue.location.lat', 'venue.location.lng']
nearby_venues =nearby_venues.loc[:, filtered_columns]
# filter the category for each row
nearby_venues['venue.categories'] = nearby_venues.apply(get_category_type, axis=1)
# clean columns
nearby_venues.columns = [col.split(".")[-1] for col in nearby_venues.columns]
nearby_venues.head()