≡ Menu

Which Social is more popular in the last 3 months in Italy?

import pandas as pd

from pytrends.request import TrendReq

# build payload
pytrend = TrendReq(hl='en-US', tz=360)

# list of keywords to get data
#Which Social is more popular in the last 3 months in Italy?
keywords = ['Twitter', 'Facebook', 'Instagram']
pytrend.build_payload(
     kw_list = keywords,
     cat=0,
     timeframe = 'today 3-m',
     geo='IT',
     gprop='')

data = pytrend.interest_over_time()

data= data.drop(labels=['isPartial'],axis='columns')

image = data.plot(title = 'Social media more popular in last 3 months on Google Trends ')
fig = image.get_figure()
fig.savefig('figure.png')
data.to_csv('Py_VS_R.csv', encoding='utf_8_sig')
{ 0 comments… add one }

Rispondi