I am using the scholarly
module in python to search for a keyword. I am getting back a generator object as follows:
import pandas as pd
import numpy as np
import scholarly
search_query = scholarly.search_keyword('Python')
print(next(search_query))
{'_filled': False,
'affiliation': 'Juelich Center for Neutron Science',
'citedby': 75900,
'email': '@fz-juelich.de',
'id': 'zWxqzzAAAAAJ',
'interests': ['Physics', 'C++', 'Python'],
'name': 'Gennady Pospelov',
'url_picture': 'https://scholar.google.com/citations?view_op=medium_photo&user=zWxqzzAAAAAJ'}
I want to access the element 'citedby' but when I try to do next(search_query)['citedby']
it returns TypeError: 'Author' object is not subscriptable
.
My question is how can I access elements in the generator object? and How can I convert that object to a Pandas dataframe?