Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot reproduce Pytrends Pull for Example keyword #1

Open
cas2247 opened this issue May 24, 2023 · 2 comments
Open

Cannot reproduce Pytrends Pull for Example keyword #1

cas2247 opened this issue May 24, 2023 · 2 comments
Assignees

Comments

@cas2247
Copy link

cas2247 commented May 24, 2023

While reviewing the sample output (thank you for that example!) I noticed that I am unable to reproduce your pytrends results for historical keyword searches.

Namely, the overlapping chart for the "suncream" keyword produces the following output and clearly demonstrates that the search volumes I extract for the (2018-01-01 00:00:00 and 2018-05-15 00:00:00) as well as the (2018-05-16 00:00:00 and 2019-02-09 00:00:00) time periods differs from the example you provided.

db7b2c0c-f51c-49b3-94ff-9fe5cb0cdab7

Importantly those time periods show extreme outliers in search volumes which results the following long-term trend after scaling:

328b5d97-36b0-433c-b354-74302d7d32ba

Because of these outliers, the longtrend.build() method returns the following error:
ValueError: unable to scale: to_scale has range 0 in overlap with scale_by; this may be because of an extreme spike in trend data

Do you have any suggestions on how to fix this error or possible explanations as to why the trends are differing so much?

Any and all advice would be greatly appreciated! Thanks in advance!

@mikedbjones
Copy link
Owner

Hi, thanks for raising this issue. I'm away for a week or so but will have a look on my return and get back to you.

@mikedbjones
Copy link
Owner

Hi @cas2247 , thanks again for the issue. Please can you let me have the exact code you're using? When I plug in those dates, I get the below. I'm wondering if it could be a geo issue, with you being in the US presumably (where 'suncream' is not a well used term), and me being in the UK. If so I'll look into why that is, but if I could have your code that would be a great help. Here are my results:

Figure_1

Figure_2

@mikedbjones mikedbjones self-assigned this Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants