{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "view-in-github", "colab_type": "text" }, "source": [ "\"Open" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "x6fHsAFVmRE3", "outputId": "3002166c-a362-4b1a-f967-cde24d8f8c5b" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Mounted at /content/drive\n" ] } ], "source": [ "from google.colab import drive\n", "drive.mount('/content/drive')" ], "id": "x6fHsAFVmRE3" }, { "cell_type": "markdown", "id": "93d1fd16-451e-455e-a30d-5e709cfde046", "metadata": { "id": "93d1fd16-451e-455e-a30d-5e709cfde046" }, "source": [ "# Energy Visualization Chart\n", "\n", "**Datascience Analysis Workflow Demonstration:**\n", " * Using Panadas `DataFrame` library to import excel sheets \n", " * Transform & Manipulate data to uncover insight using pythob \n", " * Plot, visualize data using Plotly-Dash, Matplotlib, Seaborn \n", " * Interactive Hosted Dashboard for sharing with interal team and external clients" ] }, { "cell_type": "code", "execution_count": 2, "id": "c6fe58c1-6b40-4856-bf48-048bc45809e2", "metadata": { "id": "c6fe58c1-6b40-4856-bf48-048bc45809e2" }, "outputs": [], "source": [ "!pip install plotly-express -q" ] }, { "cell_type": "code", "execution_count": 3, "id": "6a00afef-f829-4e13-bc1e-8a81083fe3b6", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 424 }, "id": "6a00afef-f829-4e13-bc1e-8a81083fe3b6", "outputId": "6e48573f-6721-48b8-c8c3-42df8065d8c9" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " HDH kW CDH kW.3\n", "0 20.5 125.61 2.5 69.18\n", "1 20.7 129.51 3.3 60.48\n", "2 21.2 119.70 3.7 60.90\n", "3 21.4 120.51 4.5 66.24\n", "4 21.8 116.28 4.7 64.71\n", "... ... ... ... ...\n", "6606 26.6 212.16 NaN NaN\n", "6607 26.8 206.37 NaN NaN\n", "6608 26.6 197.10 NaN NaN\n", "6609 26.4 194.61 NaN NaN\n", "6610 26.2 191.28 NaN NaN\n", "\n", "[6611 rows x 4 columns]" ], "text/html": [ "\n", "
\n", "
\n", "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
HDHkWCDHkW.3
020.5125.612.569.18
120.7129.513.360.48
221.2119.703.760.90
321.4120.514.566.24
421.8116.284.764.71
...............
660626.6212.16NaNNaN
660726.8206.37NaNNaN
660826.6197.10NaNNaN
660926.4194.61NaNNaN
661026.2191.28NaNNaN
\n", "

6611 rows × 4 columns

\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 3 } ], "source": [ "import pandas as pd; import numpy as np; import matplotlib.pyplot as plt\n", "\n", "csv_file = '/content/drive/MyDrive/02_CONSULTING/ENERVA/enerva_plotly/Analysis 3 with calculation - Updated Hourly.csv'\n", "data = pd.read_csv(csv_file)\n", "data = data[['HDH','kW','CDH','kW.3']]\n", "data" ] }, { "cell_type": "code", "execution_count": 4, "id": "acc3d0ec-3853-4e53-8043-e45cca5ce357", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 542 }, "id": "acc3d0ec-3853-4e53-8043-e45cca5ce357", "outputId": "01f4cf34-fbc3-43c8-a74d-6b1d425357f7" }, "outputs": [ { "output_type": "display_data", "data": { "text/html": [ "\n", "\n", "\n", "
\n", "
\n", "\n", "" ] }, "metadata": {} } ], "source": [ "import plotly.express as px\n", "\n", "fig = px.scatter(data, x=\"HDH\", y=\"kW\", trendline=\"ols\", title=\"kW vs HDH\")\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": 5, "id": "509c2d92-8d02-4378-8405-2caf884253ac", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 542 }, "id": "509c2d92-8d02-4378-8405-2caf884253ac", "outputId": "d25786bc-407f-4662-e4cb-3622de5283be" }, "outputs": [ { "output_type": "display_data", "data": { "text/html": [ "\n", "\n", "\n", "
\n", "
\n", "\n", "" ] }, "metadata": {} } ], "source": [ "fig = px.scatter(data, x=\"CDH\", y=\"kW.3\", trendline=\"ols\", title=\"kW vs CDH\")\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": 6, "id": "ec2c6488-4f43-4286-9db9-e1dda7c7854f", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 424 }, "id": "ec2c6488-4f43-4286-9db9-e1dda7c7854f", "outputId": "9005194f-18ed-4be8-f884-34ff4cd45a35" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " Hour kW Temp (°C) size\n", "0 20 123.69 5.8 0.001\n", "1 21 120.99 6.1 0.001\n", "2 16 134.19 5.0 0.001\n", "3 15 102.24 5.3 0.001\n", "4 16 102.69 5.3 0.001\n", "... ... ... ... ...\n", "1939 1 127.20 5.2 0.001\n", "1940 2 120.24 5.7 0.001\n", "1941 3 119.61 5.5 0.001\n", "1942 4 116.64 5.1 0.001\n", "1943 5 122.34 5.5 0.001\n", "\n", "[1944 rows x 4 columns]" ], "text/html": [ "\n", "
\n", "
\n", "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
HourkWTemp (°C)size
020123.695.80.001
121120.996.10.001
216134.195.00.001
315102.245.30.001
416102.695.30.001
...............
19391127.205.20.001
19402120.245.70.001
19413119.615.50.001
19424116.645.10.001
19435122.345.50.001
\n", "

1944 rows × 4 columns

\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 6 } ], "source": [ "csv3d_file = '/content/drive/MyDrive/02_CONSULTING/ENERVA/enerva_plotly/Analysis 3 with calculation - 3D.csv'\n", "data_3d = pd.read_csv(csv3d_file)\n", "data_3d['size'] = 0.001\n", "data_3d\n" ] }, { "cell_type": "code", "execution_count": 7, "id": "4114e3ec-8fc4-4668-8c9e-0f2287c9a74f", "metadata": { "id": "4114e3ec-8fc4-4668-8c9e-0f2287c9a74f", "colab": { "base_uri": "https://localhost:8080/", "height": 542 }, "outputId": "fbd7355a-f29b-4d09-a393-3e3e61ee0fb1" }, "outputs": [ { "output_type": "display_data", "data": { "text/html": [ "\n", "\n", "\n", "
\n", "
\n", "\n", "" ] }, "metadata": {} } ], "source": [ "fig = px.scatter_3d(data_3d, x='Hour', y='kW', z='Temp (°C)', size = 'size')\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": 7, "id": "5739754f-300e-498d-ade3-89d82ed08c5e", "metadata": { "id": "5739754f-300e-498d-ade3-89d82ed08c5e" }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:environmentName]", "language": "python", "name": "conda-env-environmentName-py" }, "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.7.13" }, "colab": { "provenance": [], "include_colab_link": true } }, "nbformat": 4, "nbformat_minor": 5 }