Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eshort0401 committed Sep 22, 2018
0 parents commit 0837569
Show file tree
Hide file tree
Showing 73 changed files with 32,097 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
127 changes: 127 additions & 0 deletions .ipynb_checkpoints/weatherAndTrends (1)-checkpoint.ipynb

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions .ipynb_checkpoints/weatherAndTrends-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Google Trends and Australian Weather#\n",
"## Ewan Short ##\n",
"\n",
"Welcome to a Jupyter Notebook demontration of the `weatherAndTrends.py` module! This module has one function `loadDataAndPlot` which compares Google Trends data for a given state with Australian Bureau of Meteorology station data for the capital of that state. Trend data is provided on a weekly basis, and station data is resampled weekly. Extra smoothing can be applied to both data sets using a centred running mean. The function `loadDataAndPlot` first looks locally for data; if required data is not available it retrieves it online then saves it locally. \n",
"\n",
"`loadDataAndPlot` takes four arguments. \n",
"\n",
"1. `keyword` - The Google search keyword for which data is sought. This can be any string (default 'firewood'.) \n",
"2. `state` - the Australian state over which to perform the comparison. This can be 'VIC', 'TAS', 'QLD', 'ACT', 'NSW', 'NT', 'SA' or 'WA' (default 'VIC'.) \n",
"3. `weatherVar` - The weather variable to compare with. This can be 'rain', 'minTemp', 'maxTemp', 'minRH', 'maxRH' or 'wind' (default 'maxTemp'.)\n",
"4. `smooth` - Number of weeks to smooth data over. This can be any natural number (default 1, i.e no smoothing).\n",
"\n",
"It then plots time series, a scatter plot and a periodogram for each dataset. There are no outputs. "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from weatherAndTrends import loadDataAndPlot\n",
"\n",
"loadDataAndPlot('firewood', 'VIC', 'minTemp', 1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Also available is a script `weatherAndTrendsScript.py` which can be called from the unix terminal in the form"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
":::python\n",
"python weatherAndTrendsScript.py keyword state weatherVar smooth"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
":::python\n",
"import abc"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# google_trends_project
Binary file added __pycache__/stationData.cpython-36.pyc
Binary file not shown.
Binary file added __pycache__/trendData.cpython-36.pyc
Binary file not shown.
Binary file added __pycache__/weatherAndTrends.cpython-36.pyc
Binary file not shown.
21 changes: 21 additions & 0 deletions errorExample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import logging
logging.basicConfig(level=logging.DEBUG)

import matplotlib.pyplot as plt
import numpy as np

plt.close("all")

plt.rc('text', usetex=True)

#plt.rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
## for Palatino and other serif fonts use:
#rc('font',**{'family':'serif','serif':['Palatino']})
plt.rc('text', usetex=True)

x=np.arange(1,10)

plt.plot(x,x)

plt.xlabel("$\int_0^1 \sin(\\alpha)$")
plt.show()
Binary file added figures/maxTemp_anxiety_AU_VIC.pdf
Binary file not shown.
Loading

0 comments on commit 0837569

Please sign in to comment.