Search code examples
pythongoogle-trends

'isPartial' not found in axis Pytrends


I am working on a project that requires I get google search trends for large set of stock tickers/company names (>100) for several years worth of data. I have been working in Python and using the Pytrends package, but once the timeframe you're looking at exceeds 1 year, the data returned is in weekly form, which is less than ideal. As such, I've turned to using a function from 'dailydata', the 'get_daily_data()' function. However, for certain search terms, I get the error from the title: "['isPartial'] not found in axis." Having seen the weekly results from interest_over_time(), I know roughly what this isPartial variable refers to, and I know the 'axis' issue has something to do with certain variables being dropped. However, how this get_daily_data works under the hood is a little bit unclear to me. Below is the code I'm testing:

from pytrends.request import TrendReq
from pytrends import dailydata

data = dailydata.get_daily_data('Live Oak Acquisition Corp. II', 2020, 11, 2021, 12) 

Any suggestions as to how to get around this error, or more generally how to get daily data from Pytrends for longer periods of time would be sincerely appreciated. Thank you.


Solution

  • It just means that the dataframe is empty because Google Trends has no data for this search term. You can see it yourself if you go to Google Trends and search for the term. It is a bug however from pytrends so you can just either catch the error, which is what I would suggest, or modify the source code.