我正在使用pytrends python包来提升搜索词的流行程度。看起来默认频率是每周,但我需要每日数据。是否有一个参数来调整?我似乎找不到任何东西。这里有一些代码可以让你到达同一个地方......
grep
如您所见,返回的数据帧每周采样一次。我怎样才能获得相同的数据,可以追溯到5年前,但是每天?
答案 0 :(得分:0)
我正在搜索此问题,因为我正在搜索此主题。截止到今天(2019年),pytrends
库中有一种方法可以返回关键字的每日数据。
我建议检查他们的github repository。
我应该指出,我没有测试它可以获取多远的数据,但是我确定文档中的某处具有此信息。
from pytrends.request import TrendReq
from pytrends import dailydata
df = dailydata.get_daily_data('cinema', 2019, 1, 2019, 10, geo = 'BR')
print(df)
cinema_unscaled cinema_monthly isPartial scale cinema
date
2019-01-01 60 NaN NaN NaN NaN
2019-01-02 76 NaN NaN NaN NaN
2019-01-03 82 NaN NaN NaN NaN
2019-01-04 71 NaN NaN NaN NaN
2019-01-05 100 NaN NaN NaN NaN
... ... ... ... ...
2019-10-26 74 38.0 NaN 0.38 28.12
2019-10-27 74 33.0 True 0.33 24.42
2019-10-28 53 33.0 NaN 0.33 17.49
2019-10-29 37 33.0 NaN 0.33 12.21
2019-10-30 34 33.0 NaN 0.33 11.22