I have obtained some data from YouTube API, and the result is a long list of multiple dictionaries. How should I write to convert it to dataframe by pandas? Thank you so much
The result looks like this:
{'kind': 'youtube#searchListResponse', 'etag': 'yY4OdBV-3CJjWS2MeWgEXd-Ogms', 'nextPageToken': 'CAUQAA', 'regionCode': 'US', 'pageInfo': {'totalResults': 1000000, 'resultsPerPage': 5}, 'items': [{'kind': 'youtube#searchResult', 'etag': 'Wd2zcg5tEG4RsxAygUiAWvwWfKs', 'id': {'kind': 'youtube#video', 'videoId': 'UVpw1lWrxco'}, 'snippet': {'publishedAt': '2018-04-05T07:00:21Z', 'channelId': 'UCnibAqWKNP4kSfXvvIIir4g', 'title': 'Ex Parte', 'description': "The BAU takes charge of a hostage situation at a law firm in D.C., where Matt Simmons' wife, Kristy (Kelly Frye), works.", 'thumbnails': {'default': {'url': 'https://i.ytimg.com/vi/UVpw1lWrxco/default.jpg', 'width': 120, 'height': 90}, 'medium': {'url': 'https://i.ytimg.com/vi/UVpw1lWrxco/mqdefault.jpg', 'width': 320, 'height': 180}, 'high': {'url': 'https://i.ytimg.com/vi/UVpw1lWrxco/hqdefault.jpg', 'width': 480, 'height': 360}}, 'channelTitle': 'Criminal Minds', 'liveBroadcastContent': 'none', 'publishTime': '2018-04-05T07:00:21Z'}},
I've tried to use df = pd.DataFrame.from_dict(data)
but it didn't work as it's multiple layers of dictionaries.