Created
September 20, 2022 11:30
-
-
Save eliasdabbas/1b89f10e2c6ff6a809523c0fd9b99f05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import advertools as adv | |
import pandas as pd | |
key = 'YOUR_GOOGLE_KEY' | |
brands = [ | |
'nike', | |
'adidas', | |
'puma', | |
'asics', | |
'columbia', | |
'diadora', | |
'fila', | |
] | |
languages = ['en', 'fr', 'it', 'de', 'pt', 'es'] | |
sports = adv.knowledge_graph( | |
key=key, | |
query=brands, | |
languages=languages) | |
brand = brands[i] # <--- change to get a different chart | |
(sports[sports['query'].eq(brand)] | |
.groupby(['query', 'languages']) | |
.head() | |
.head(50) | |
.reset_index(drop=True) | |
[['query', 'languages', 'resultScore', 'result.description']] | |
.style.format({'resultScore': '{:,.0f}'}) | |
.bar()) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Raw data: https://bit.ly/3dqJhWt