-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0837569
Showing
73 changed files
with
32,097 additions
and
0 deletions.
There are no files selected for viewing
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
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
127
.ipynb_checkpoints/weatherAndTrends (1)-checkpoint.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# google_trends_project |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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 not shown.
Oops, something went wrong.