From 0b4790c064b099d9024e1d1647c4fd400662da9f Mon Sep 17 00:00:00 2001 From: WolfBerwouts Date: Mon, 18 Dec 2017 22:44:15 +0100 Subject: [PATCH] Analyze water consumption --- notebooks/Analyze water consumption.ipynb | 95 +++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 notebooks/Analyze water consumption.ipynb diff --git a/notebooks/Analyze water consumption.ipynb b/notebooks/Analyze water consumption.ipynb new file mode 100644 index 0000000..0d04063 --- /dev/null +++ b/notebooks/Analyze water consumption.ipynb @@ -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 +}