Google Trends is pretty awesome, except that on the site you cannot do more than overlay plots. Here we'll play with search term data downloaded from Google and draw our own conclusions.
We will be using numpy and matplotlib to explore the data. Remember you can import all these modules at once using:
In [2]:
%pylab inline
In [3]:
# we can import the CSV data as a numpy rec array
from matplotlib.pylab import csv2rec
trends = csv2rec('trends.csv')
In [ ]:
In [2]:
In [ ]:
numpy
has tools for cross-correlations:
result = np.correlate(trends.spring_break,trends.spring_break,mode='full')
plot(arange(result.size) - result.size/2,result)
In [ ]:
In [ ]: