I am using the pytrends
related_queries()
function to find related keywords for a list of keywords but if one of the keywords doesn't have enough data to provide related queries the process crashes with the error:
KeyError: "[u'query' u'value'] not in index"
After the error has occurred the code won't work for any keyword until I shut down and restart the Kernel so I haven't had any success in trying to catch the error. An example that doesn't work is:
pytrend.build_payload(kw_list=['AMX HOME AUTOMATION'])
Related_df = pytrend.related_queries()