Skip to content

Commit

Permalink
Merge branch 'WolfBerwouts-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
saroele committed Jan 18, 2018
2 parents 7d25cb4 + 9e365b1 commit 23d65ab
Showing 1 changed file with 95 additions and 0 deletions.
95 changes: 95 additions & 0 deletions notebooks/Analyze water consumption.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import opengrid as og\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"og.datasets.list_available()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ts = og.datasets.get('water_2016_hour')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ts.plot()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ts = ts.reset_index()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plt.figure()\n",
"ts2=ts[ts>2]\n",
"ts2=ts[ts<20]\n",
"ts2.hist(bins=100)\n",
"plt.xlabel('Water consumption [l/min]')\n",
"plt.ylabel('Frequency')\n",
"plt.title('Water consumption histogram')"
]
}
],
"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.5.1"
}
},
"nbformat": 4,
"nbformat_minor": 1
}

0 comments on commit 23d65ab

Please sign in to comment.