Spaces:
Sleeping
Sleeping
more graphs
Browse files- app/app.py +63 -1
- app/dashboard.ipynb +79 -22
- app/data/water_consumption/monthly/16NSJNnjLK4MndjZYaKYGKEV_month.csv +3 -0
- app/data/water_consumption/monthly/7uLwefnSt8CgVlmIGY8emqJK_month.csv +3 -0
- app/data/water_consumption/monthly/8yS04Ddkk3pPL8e9Rku4LJtc_month.csv +3 -0
- app/data/water_consumption/monthly/Cwp33jA19hp9VdoNJUlj6USf_month.csv +3 -0
- app/data/water_consumption/monthly/KN9Z3gANLftDuUGvgs8O38dI_month.csv +3 -0
- app/data/water_consumption/monthly/LzbMafI31IosheUI7YGhj5at_month.csv +3 -0
- app/data/water_consumption/monthly/PHqaZDuMTRvCZCvA259Z1vJu_month.csv +3 -0
- app/data/water_consumption/monthly/RZngVU6axOdshmfma0yNAajE_month.csv +3 -0
- app/data/water_consumption/monthly/SQUOjMB6zAgYpSJEMy46tKXJ_month.csv +3 -0
- app/data/water_consumption/monthly/UcufQVoJQPbfLzIBnSsUodJP_month.csv +3 -0
- app/data/water_consumption/monthly/VTuh8oxtC6YlOCLeScXfLuY3_month.csv +3 -0
- app/data/water_consumption/monthly/VZTnyVO3TP3ILuYsN5Xw9UR0_month.csv +3 -0
- app/data/water_consumption/monthly/WyPRjcmBXJZoC9DIURMXKxn8_month.csv +3 -0
- app/data/water_consumption/monthly/iBFIAuvh7bCNyOQDo0jkjhRV_month.csv +3 -0
- app/data/water_consumption/monthly/iNVKpGfGW6rU17eOtxpZSFWR_month.csv +3 -0
- app/data/water_consumption/monthly/kaTMmHVh8gXUbHMppzdmdzpv_month.csv +3 -0
- app/data/water_consumption/monthly/yPtlbyLlDlzeBZQYrPYaByoB_month.csv +3 -0
app/app.py
CHANGED
@@ -82,6 +82,20 @@ dataset_water_consumption_dfs = {
|
|
82 |
"RZngVU6axOdshmfma0yNAajE": pd.read_csv('data/water_consumption/RZngVU6axOdshmfma0yNAajE_water_consumption.csv'),
|
83 |
"SQUOjMB6zAgYpSJEMy46tKXJ": pd.read_csv('data/water_consumption/SQUOjMB6zAgYpSJEMy46tKXJ_water_consumption.csv'),
|
84 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
# provide a scalar value to enable the slider to select ideal temperature
|
87 |
ideal_temperature = 50
|
@@ -154,6 +168,21 @@ dashboard_layout = html.Div([
|
|
154 |
html.H4('Hourly'),
|
155 |
dcc.Graph(id='water_consumption_hourly_graph')
|
156 |
], className='six columns',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
)
|
158 |
], className='row'),
|
159 |
html.Div(
|
@@ -245,6 +274,8 @@ def display_page(pathname):
|
|
245 |
Output('dataset-graph', 'figure'),
|
246 |
Output('water-consumption-graph', 'figure'),
|
247 |
Output('water_consumption_hourly_graph', 'figure'),
|
|
|
|
|
248 |
Output('solution-status', 'children'),
|
249 |
Input('dataset-dropdown', 'value'),
|
250 |
Input('solution-dropdown', 'value'),
|
@@ -299,6 +330,37 @@ def update_graph(dataset, solution, ideal_temperature):
|
|
299 |
water_consumption_hourly_graph.update_xaxes(title_text="Hour of day")
|
300 |
water_consumption_hourly_graph.update_yaxes(title_text="Number of water usages")
|
301 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
|
303 |
# Policy Graph
|
304 |
policy_readable_graph = px.line(data, x='hour', y='policy_readable',
|
@@ -346,7 +408,7 @@ def update_graph(dataset, solution, ideal_temperature):
|
|
346 |
color_discrete_sequence=['green']
|
347 |
).data[0])
|
348 |
result = "No solution found"
|
349 |
-
return policy_readable_graph, energy_consumption_graph, comfort_graph, dataset_graph, water_consumption_graph, water_consumption_hourly_graph, result
|
350 |
|
351 |
|
352 |
if __name__ == "__main__":
|
|
|
82 |
"RZngVU6axOdshmfma0yNAajE": pd.read_csv('data/water_consumption/RZngVU6axOdshmfma0yNAajE_water_consumption.csv'),
|
83 |
"SQUOjMB6zAgYpSJEMy46tKXJ": pd.read_csv('data/water_consumption/SQUOjMB6zAgYpSJEMy46tKXJ_water_consumption.csv'),
|
84 |
}
|
85 |
+
dataset_water_consumption_monthly_dfs = {
|
86 |
+
"16NSJNnjLK4MndjZYaKYGKEV": pd.read_csv('data/water_consumption/monthly/16NSJNnjLK4MndjZYaKYGKEV_month.csv'),
|
87 |
+
"7uLwefnSt8CgVlmIGY8emqJK": pd.read_csv('data/water_consumption/monthly/7uLwefnSt8CgVlmIGY8emqJK_month.csv'),
|
88 |
+
"8yS04Ddkk3pPL8e9Rku4LJtc": pd.read_csv('data/water_consumption/monthly/8yS04Ddkk3pPL8e9Rku4LJtc_month.csv'),
|
89 |
+
"Cwp33jA19hp9VdoNJUlj6USf": pd.read_csv('data/water_consumption/monthly/Cwp33jA19hp9VdoNJUlj6USf_month.csv'),
|
90 |
+
"iBFIAuvh7bCNyOQDo0jkjhRV": pd.read_csv('data/water_consumption/monthly/iBFIAuvh7bCNyOQDo0jkjhRV_month.csv'),
|
91 |
+
"iNVKpGfGW6rU17eOtxpZSFWR": pd.read_csv('data/water_consumption/monthly/iNVKpGfGW6rU17eOtxpZSFWR_month.csv'),
|
92 |
+
"kaTMmHVh8gXUbHMppzdmdzpv": pd.read_csv('data/water_consumption/monthly/kaTMmHVh8gXUbHMppzdmdzpv_month.csv'),
|
93 |
+
"KN9Z3gANLftDuUGvgs8O38dI": pd.read_csv('data/water_consumption/monthly/KN9Z3gANLftDuUGvgs8O38dI_month.csv'),
|
94 |
+
"LzbMafI31IosheUI7YGhj5at": pd.read_csv('data/water_consumption/monthly/LzbMafI31IosheUI7YGhj5at_month.csv'),
|
95 |
+
"PHqaZDuMTRvCZCvA259Z1vJu": pd.read_csv('data/water_consumption/monthly/PHqaZDuMTRvCZCvA259Z1vJu_month.csv'),
|
96 |
+
"RZngVU6axOdshmfma0yNAajE": pd.read_csv('data/water_consumption/monthly/RZngVU6axOdshmfma0yNAajE_month.csv'),
|
97 |
+
"SQUOjMB6zAgYpSJEMy46tKXJ": pd.read_csv('data/water_consumption/monthly/SQUOjMB6zAgYpSJEMy46tKXJ_month.csv'),
|
98 |
+
}
|
99 |
|
100 |
# provide a scalar value to enable the slider to select ideal temperature
|
101 |
ideal_temperature = 50
|
|
|
168 |
html.H4('Hourly'),
|
169 |
dcc.Graph(id='water_consumption_hourly_graph')
|
170 |
], className='six columns',
|
171 |
+
),
|
172 |
+
html.Div(
|
173 |
+
[
|
174 |
+
html.H4('Day of the Week'),
|
175 |
+
dcc.Graph(id='water_consumption_week_day_graph')
|
176 |
+
], className='six columns',
|
177 |
+
)
|
178 |
+
], className='row'),
|
179 |
+
html.Div(
|
180 |
+
[
|
181 |
+
html.Div(
|
182 |
+
[
|
183 |
+
html.H4('Monthly'),
|
184 |
+
dcc.Graph(id='water_consumption_monthly_graph')
|
185 |
+
], className='six columns',
|
186 |
)
|
187 |
], className='row'),
|
188 |
html.Div(
|
|
|
274 |
Output('dataset-graph', 'figure'),
|
275 |
Output('water-consumption-graph', 'figure'),
|
276 |
Output('water_consumption_hourly_graph', 'figure'),
|
277 |
+
Output('water_consumption_week_day_graph', 'figure'),
|
278 |
+
Output('water_consumption_monthly_graph', 'figure'),
|
279 |
Output('solution-status', 'children'),
|
280 |
Input('dataset-dropdown', 'value'),
|
281 |
Input('solution-dropdown', 'value'),
|
|
|
330 |
water_consumption_hourly_graph.update_xaxes(title_text="Hour of day")
|
331 |
water_consumption_hourly_graph.update_yaxes(title_text="Number of water usages")
|
332 |
|
333 |
+
# Water Consumption Week Day Graph
|
334 |
+
order = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
|
335 |
+
water_consumption_df["datetime"] = pd.to_datetime(water_consumption_df["ts"], errors='coerce')
|
336 |
+
#create columns with day of week
|
337 |
+
water_consumption_df['day_of_week'] = water_consumption_df["datetime"].apply(lambda x: x.day_name())
|
338 |
+
#turn day of week number into day of week name
|
339 |
+
#df['day_of_week'] = df['day_of_week'].apply(lambda x: calendar.day_name[x])
|
340 |
+
week_series = water_consumption_df.groupby("day_of_week")["water_consumption_bool"].sum().loc[order]
|
341 |
+
|
342 |
+
# Water Consumption Week Day Graph
|
343 |
+
water_consumption_week_day_graph = go.Figure()
|
344 |
+
water_consumption_week_day_graph.add_trace(go.Bar(x=week_series.index, y=week_series.values, name='Water consumption per day of week'))
|
345 |
+
water_consumption_week_day_graph.update_layout(
|
346 |
+
title_text="Water consumption per day of week"
|
347 |
+
)
|
348 |
+
water_consumption_week_day_graph.update_xaxes(title_text="Day of week")
|
349 |
+
water_consumption_week_day_graph.update_yaxes(title_text="Number of water usages")
|
350 |
+
|
351 |
+
#dataset_water_consumption_monthly_dfs
|
352 |
+
#Water Consumption Monthly Graph
|
353 |
+
water_consumption_monthly_df = dataset_water_consumption_monthly_dfs[dataset]
|
354 |
+
water_consumption_monthly_graph = go.Figure()
|
355 |
+
water_consumption_monthly_graph.add_trace(go.Bar(x=water_consumption_monthly_df["month"], y=water_consumption_monthly_df["water_consumption_bool"], name='Water consumption per month'))
|
356 |
+
water_consumption_monthly_graph.update_layout(
|
357 |
+
title_text="Water consumption per month"
|
358 |
+
)
|
359 |
+
water_consumption_monthly_graph.update_xaxes(title_text="Month")
|
360 |
+
water_consumption_monthly_graph.update_yaxes(title_text="Number of water usages")
|
361 |
+
|
362 |
+
|
363 |
+
|
364 |
|
365 |
# Policy Graph
|
366 |
policy_readable_graph = px.line(data, x='hour', y='policy_readable',
|
|
|
408 |
color_discrete_sequence=['green']
|
409 |
).data[0])
|
410 |
result = "No solution found"
|
411 |
+
return policy_readable_graph, energy_consumption_graph, comfort_graph, dataset_graph, water_consumption_graph, water_consumption_hourly_graph, water_consumption_week_day_graph,water_consumption_monthly_graph, result
|
412 |
|
413 |
|
414 |
if __name__ == "__main__":
|
app/dashboard.ipynb
CHANGED
@@ -2,39 +2,34 @@
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
-
"execution_count":
|
6 |
"metadata": {},
|
7 |
"outputs": [
|
8 |
{
|
9 |
"name": "stderr",
|
10 |
"output_type": "stream",
|
11 |
"text": [
|
12 |
-
"/var/folders/b4/lwfgccm95kqd2skcwvrt2fr00000gn/T/ipykernel_34004/
|
13 |
"\n",
|
14 |
"The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n",
|
15 |
"\n"
|
16 |
]
|
17 |
},
|
18 |
{
|
19 |
-
"
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
]
|
32 |
-
|
33 |
-
"<IPython.lib.display.IFrame at 0x15e45a110>"
|
34 |
-
]
|
35 |
-
},
|
36 |
-
"metadata": {},
|
37 |
-
"output_type": "display_data"
|
38 |
}
|
39 |
],
|
40 |
"source": [
|
@@ -122,6 +117,20 @@
|
|
122 |
" \"RZngVU6axOdshmfma0yNAajE\": pd.read_csv('data/water_consumption/RZngVU6axOdshmfma0yNAajE_water_consumption.csv'),\n",
|
123 |
" \"SQUOjMB6zAgYpSJEMy46tKXJ\": pd.read_csv('data/water_consumption/SQUOjMB6zAgYpSJEMy46tKXJ_water_consumption.csv'),\n",
|
124 |
"}\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
"\n",
|
126 |
"# provide a scalar value to enable the slider to select ideal temperature\n",
|
127 |
"ideal_temperature = 50\n",
|
@@ -194,6 +203,21 @@
|
|
194 |
" html.H4('Hourly'),\n",
|
195 |
" dcc.Graph(id='water_consumption_hourly_graph')\n",
|
196 |
" ], className='six columns',\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
" )\n",
|
198 |
" ], className='row'),\n",
|
199 |
" html.Div(\n",
|
@@ -285,6 +309,8 @@
|
|
285 |
" Output('dataset-graph', 'figure'),\n",
|
286 |
" Output('water-consumption-graph', 'figure'),\n",
|
287 |
" Output('water_consumption_hourly_graph', 'figure'),\n",
|
|
|
|
|
288 |
" Output('solution-status', 'children'),\n",
|
289 |
" Input('dataset-dropdown', 'value'),\n",
|
290 |
" Input('solution-dropdown', 'value'),\n",
|
@@ -339,6 +365,37 @@
|
|
339 |
" water_consumption_hourly_graph.update_xaxes(title_text=\"Hour of day\")\n",
|
340 |
" water_consumption_hourly_graph.update_yaxes(title_text=\"Number of water usages\")\n",
|
341 |
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
"\n",
|
343 |
" # Policy Graph\n",
|
344 |
" policy_readable_graph = px.line(data, x='hour', y='policy_readable',\n",
|
@@ -386,7 +443,7 @@
|
|
386 |
" color_discrete_sequence=['green']\n",
|
387 |
" ).data[0])\n",
|
388 |
" result = \"No solution found\"\n",
|
389 |
-
" return policy_readable_graph, energy_consumption_graph, comfort_graph, dataset_graph, water_consumption_graph, water_consumption_hourly_graph, result\n",
|
390 |
"\n",
|
391 |
"\n",
|
392 |
"if __name__ == \"__main__\":\n",
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": 32,
|
6 |
"metadata": {},
|
7 |
"outputs": [
|
8 |
{
|
9 |
"name": "stderr",
|
10 |
"output_type": "stream",
|
11 |
"text": [
|
12 |
+
"/var/folders/b4/lwfgccm95kqd2skcwvrt2fr00000gn/T/ipykernel_34004/147804699.py:17: FutureWarning:\n",
|
13 |
"\n",
|
14 |
"The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n",
|
15 |
"\n"
|
16 |
]
|
17 |
},
|
18 |
{
|
19 |
+
"ename": "FileNotFoundError",
|
20 |
+
"evalue": "[Errno 2] No such file or directory: 'data/water_consumption/montly/16NSJNnjLK4MndjZYaKYGKEV_month.csv'",
|
21 |
+
"output_type": "error",
|
22 |
+
"traceback": [
|
23 |
+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
24 |
+
"\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
|
25 |
+
"\u001b[1;32m/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb Cell 1\u001b[0m line \u001b[0;36m8\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=56'>57</a>\u001b[0m dataset_original_dfs \u001b[39m=\u001b[39m {\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=57'>58</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39m16NSJNnjLK4MndjZYaKYGKEV\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/original/16NSJNnjLK4MndjZYaKYGKEV.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=58'>59</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39m7uLwefnSt8CgVlmIGY8emqJK\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/original/7uLwefnSt8CgVlmIGY8emqJK.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=68'>69</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mSQUOjMB6zAgYpSJEMy46tKXJ\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/original/SQUOjMB6zAgYpSJEMy46tKXJ.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=69'>70</a>\u001b[0m }\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=70'>71</a>\u001b[0m dataset_water_consumption_dfs \u001b[39m=\u001b[39m {\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=71'>72</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39m16NSJNnjLK4MndjZYaKYGKEV\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/water_consumption/16NSJNnjLK4MndjZYaKYGKEV_water_consumption.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=72'>73</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39m7uLwefnSt8CgVlmIGY8emqJK\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/water_consumption/7uLwefnSt8CgVlmIGY8emqJK_water_consumption.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=82'>83</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mSQUOjMB6zAgYpSJEMy46tKXJ\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/water_consumption/SQUOjMB6zAgYpSJEMy46tKXJ_water_consumption.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=83'>84</a>\u001b[0m }\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=84'>85</a>\u001b[0m dataset_water_consumption_monthly_dfs \u001b[39m=\u001b[39m {\n\u001b[0;32m---> <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=85'>86</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39m16NSJNnjLK4MndjZYaKYGKEV\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39;49mread_csv(\u001b[39m'\u001b[39;49m\u001b[39mdata/water_consumption/montly/16NSJNnjLK4MndjZYaKYGKEV_month.csv\u001b[39;49m\u001b[39m'\u001b[39;49m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=86'>87</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39m7uLwefnSt8CgVlmIGY8emqJK\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/water_consumption/montly/7uLwefnSt8CgVlmIGY8emqJK_month.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=87'>88</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39m8yS04Ddkk3pPL8e9Rku4LJtc\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/water_consumption/montly/8yS04Ddkk3pPL8e9Rku4LJtc_month.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=88'>89</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mCwp33jA19hp9VdoNJUlj6USf\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/water_consumption/montly/Cwp33jA19hp9VdoNJUlj6USf_month.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=89'>90</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39miBFIAuvh7bCNyOQDo0jkjhRV\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/water_consumption/montly/iBFIAuvh7bCNyOQDo0jkjhRV_month.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=90'>91</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39miNVKpGfGW6rU17eOtxpZSFWR\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/water_consumption/montly/iNVKpGfGW6rU17eOtxpZSFWR_month.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=91'>92</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mkaTMmHVh8gXUbHMppzdmdzpv\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/water_consumption/montly/kaTMmHVh8gXUbHMppzdmdzpv_monthcsv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=92'>93</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mKN9Z3gANLftDuUGvgs8O38dI\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/water_consumption/montly/KN9Z3gANLftDuUGvgs8O38dI_month.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=93'>94</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mLzbMafI31IosheUI7YGhj5at\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/water_consumption/montly/LzbMafI31IosheUI7YGhj5at_month.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=94'>95</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mPHqaZDuMTRvCZCvA259Z1vJu\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/water_consumption/montly/PHqaZDuMTRvCZCvA259Z1vJu_month.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=95'>96</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mRZngVU6axOdshmfma0yNAajE\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/water_consumption/montly/RZngVU6axOdshmfma0yNAajE_month.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=96'>97</a>\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mSQUOjMB6zAgYpSJEMy46tKXJ\u001b[39m\u001b[39m\"\u001b[39m: pd\u001b[39m.\u001b[39mread_csv(\u001b[39m'\u001b[39m\u001b[39mdata/water_consumption/montly/SQUOjMB6zAgYpSJEMy46tKXJ_month.csv\u001b[39m\u001b[39m'\u001b[39m),\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=97'>98</a>\u001b[0m }\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=99'>100</a>\u001b[0m \u001b[39m# provide a scalar value to enable the slider to select ideal temperature\u001b[39;00m\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/ruimelo/Documents/GitHub/atc-smart-shower/frontend/app/dashboard.ipynb#W5sZmlsZQ%3D%3D?line=100'>101</a>\u001b[0m ideal_temperature \u001b[39m=\u001b[39m \u001b[39m50\u001b[39m\n",
|
26 |
+
"File \u001b[0;32m~/anaconda3/envs/atc/lib/python3.10/site-packages/pandas/io/parsers/readers.py:948\u001b[0m, in \u001b[0;36mread_csv\u001b[0;34m(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, date_format, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options, dtype_backend)\u001b[0m\n\u001b[1;32m 935\u001b[0m kwds_defaults \u001b[39m=\u001b[39m _refine_defaults_read(\n\u001b[1;32m 936\u001b[0m dialect,\n\u001b[1;32m 937\u001b[0m delimiter,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 944\u001b[0m dtype_backend\u001b[39m=\u001b[39mdtype_backend,\n\u001b[1;32m 945\u001b[0m )\n\u001b[1;32m 946\u001b[0m kwds\u001b[39m.\u001b[39mupdate(kwds_defaults)\n\u001b[0;32m--> 948\u001b[0m \u001b[39mreturn\u001b[39;00m _read(filepath_or_buffer, kwds)\n",
|
27 |
+
"File \u001b[0;32m~/anaconda3/envs/atc/lib/python3.10/site-packages/pandas/io/parsers/readers.py:611\u001b[0m, in \u001b[0;36m_read\u001b[0;34m(filepath_or_buffer, kwds)\u001b[0m\n\u001b[1;32m 608\u001b[0m _validate_names(kwds\u001b[39m.\u001b[39mget(\u001b[39m\"\u001b[39m\u001b[39mnames\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39mNone\u001b[39;00m))\n\u001b[1;32m 610\u001b[0m \u001b[39m# Create the parser.\u001b[39;00m\n\u001b[0;32m--> 611\u001b[0m parser \u001b[39m=\u001b[39m TextFileReader(filepath_or_buffer, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwds)\n\u001b[1;32m 613\u001b[0m \u001b[39mif\u001b[39;00m chunksize \u001b[39mor\u001b[39;00m iterator:\n\u001b[1;32m 614\u001b[0m \u001b[39mreturn\u001b[39;00m parser\n",
|
28 |
+
"File \u001b[0;32m~/anaconda3/envs/atc/lib/python3.10/site-packages/pandas/io/parsers/readers.py:1448\u001b[0m, in \u001b[0;36mTextFileReader.__init__\u001b[0;34m(self, f, engine, **kwds)\u001b[0m\n\u001b[1;32m 1445\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39moptions[\u001b[39m\"\u001b[39m\u001b[39mhas_index_names\u001b[39m\u001b[39m\"\u001b[39m] \u001b[39m=\u001b[39m kwds[\u001b[39m\"\u001b[39m\u001b[39mhas_index_names\u001b[39m\u001b[39m\"\u001b[39m]\n\u001b[1;32m 1447\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mhandles: IOHandles \u001b[39m|\u001b[39m \u001b[39mNone\u001b[39;00m \u001b[39m=\u001b[39m \u001b[39mNone\u001b[39;00m\n\u001b[0;32m-> 1448\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_engine \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_make_engine(f, \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mengine)\n",
|
29 |
+
"File \u001b[0;32m~/anaconda3/envs/atc/lib/python3.10/site-packages/pandas/io/parsers/readers.py:1705\u001b[0m, in \u001b[0;36mTextFileReader._make_engine\u001b[0;34m(self, f, engine)\u001b[0m\n\u001b[1;32m 1703\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39m\"\u001b[39m\u001b[39mb\u001b[39m\u001b[39m\"\u001b[39m \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m mode:\n\u001b[1;32m 1704\u001b[0m mode \u001b[39m+\u001b[39m\u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39mb\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m-> 1705\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mhandles \u001b[39m=\u001b[39m get_handle(\n\u001b[1;32m 1706\u001b[0m f,\n\u001b[1;32m 1707\u001b[0m mode,\n\u001b[1;32m 1708\u001b[0m encoding\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49moptions\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mencoding\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39mNone\u001b[39;49;00m),\n\u001b[1;32m 1709\u001b[0m compression\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49moptions\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mcompression\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39mNone\u001b[39;49;00m),\n\u001b[1;32m 1710\u001b[0m memory_map\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49moptions\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mmemory_map\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39mFalse\u001b[39;49;00m),\n\u001b[1;32m 1711\u001b[0m is_text\u001b[39m=\u001b[39;49mis_text,\n\u001b[1;32m 1712\u001b[0m errors\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49moptions\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mencoding_errors\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39m\"\u001b[39;49m\u001b[39mstrict\u001b[39;49m\u001b[39m\"\u001b[39;49m),\n\u001b[1;32m 1713\u001b[0m storage_options\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49moptions\u001b[39m.\u001b[39;49mget(\u001b[39m\"\u001b[39;49m\u001b[39mstorage_options\u001b[39;49m\u001b[39m\"\u001b[39;49m, \u001b[39mNone\u001b[39;49;00m),\n\u001b[1;32m 1714\u001b[0m )\n\u001b[1;32m 1715\u001b[0m \u001b[39massert\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mhandles \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m\n\u001b[1;32m 1716\u001b[0m f \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mhandles\u001b[39m.\u001b[39mhandle\n",
|
30 |
+
"File \u001b[0;32m~/anaconda3/envs/atc/lib/python3.10/site-packages/pandas/io/common.py:863\u001b[0m, in \u001b[0;36mget_handle\u001b[0;34m(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)\u001b[0m\n\u001b[1;32m 858\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(handle, \u001b[39mstr\u001b[39m):\n\u001b[1;32m 859\u001b[0m \u001b[39m# Check whether the filename is to be opened in binary mode.\u001b[39;00m\n\u001b[1;32m 860\u001b[0m \u001b[39m# Binary mode does not support 'encoding' and 'newline'.\u001b[39;00m\n\u001b[1;32m 861\u001b[0m \u001b[39mif\u001b[39;00m ioargs\u001b[39m.\u001b[39mencoding \u001b[39mand\u001b[39;00m \u001b[39m\"\u001b[39m\u001b[39mb\u001b[39m\u001b[39m\"\u001b[39m \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m ioargs\u001b[39m.\u001b[39mmode:\n\u001b[1;32m 862\u001b[0m \u001b[39m# Encoding\u001b[39;00m\n\u001b[0;32m--> 863\u001b[0m handle \u001b[39m=\u001b[39m \u001b[39mopen\u001b[39;49m(\n\u001b[1;32m 864\u001b[0m handle,\n\u001b[1;32m 865\u001b[0m ioargs\u001b[39m.\u001b[39;49mmode,\n\u001b[1;32m 866\u001b[0m encoding\u001b[39m=\u001b[39;49mioargs\u001b[39m.\u001b[39;49mencoding,\n\u001b[1;32m 867\u001b[0m errors\u001b[39m=\u001b[39;49merrors,\n\u001b[1;32m 868\u001b[0m newline\u001b[39m=\u001b[39;49m\u001b[39m\"\u001b[39;49m\u001b[39m\"\u001b[39;49m,\n\u001b[1;32m 869\u001b[0m )\n\u001b[1;32m 870\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 871\u001b[0m \u001b[39m# Binary mode\u001b[39;00m\n\u001b[1;32m 872\u001b[0m handle \u001b[39m=\u001b[39m \u001b[39mopen\u001b[39m(handle, ioargs\u001b[39m.\u001b[39mmode)\n",
|
31 |
+
"\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'data/water_consumption/montly/16NSJNnjLK4MndjZYaKYGKEV_month.csv'"
|
32 |
+
]
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
],
|
35 |
"source": [
|
|
|
117 |
" \"RZngVU6axOdshmfma0yNAajE\": pd.read_csv('data/water_consumption/RZngVU6axOdshmfma0yNAajE_water_consumption.csv'),\n",
|
118 |
" \"SQUOjMB6zAgYpSJEMy46tKXJ\": pd.read_csv('data/water_consumption/SQUOjMB6zAgYpSJEMy46tKXJ_water_consumption.csv'),\n",
|
119 |
"}\n",
|
120 |
+
"dataset_water_consumption_monthly_dfs = {\n",
|
121 |
+
" \"16NSJNnjLK4MndjZYaKYGKEV\": pd.read_csv('data/water_consumption/monthly/16NSJNnjLK4MndjZYaKYGKEV_month.csv'),\n",
|
122 |
+
" \"7uLwefnSt8CgVlmIGY8emqJK\": pd.read_csv('data/water_consumption/monthly/7uLwefnSt8CgVlmIGY8emqJK_month.csv'),\n",
|
123 |
+
" \"8yS04Ddkk3pPL8e9Rku4LJtc\": pd.read_csv('data/water_consumption/monthly/8yS04Ddkk3pPL8e9Rku4LJtc_month.csv'),\n",
|
124 |
+
" \"Cwp33jA19hp9VdoNJUlj6USf\": pd.read_csv('data/water_consumption/monthly/Cwp33jA19hp9VdoNJUlj6USf_month.csv'),\n",
|
125 |
+
" \"iBFIAuvh7bCNyOQDo0jkjhRV\": pd.read_csv('data/water_consumption/monthly/iBFIAuvh7bCNyOQDo0jkjhRV_month.csv'),\n",
|
126 |
+
" \"iNVKpGfGW6rU17eOtxpZSFWR\": pd.read_csv('data/water_consumption/monthly/iNVKpGfGW6rU17eOtxpZSFWR_month.csv'),\n",
|
127 |
+
" \"kaTMmHVh8gXUbHMppzdmdzpv\": pd.read_csv('data/water_consumption/monthly/kaTMmHVh8gXUbHMppzdmdzpv_monthcsv'),\n",
|
128 |
+
" \"KN9Z3gANLftDuUGvgs8O38dI\": pd.read_csv('data/water_consumption/monthly/KN9Z3gANLftDuUGvgs8O38dI_month.csv'),\n",
|
129 |
+
" \"LzbMafI31IosheUI7YGhj5at\": pd.read_csv('data/water_consumption/monthly/LzbMafI31IosheUI7YGhj5at_month.csv'),\n",
|
130 |
+
" \"PHqaZDuMTRvCZCvA259Z1vJu\": pd.read_csv('data/water_consumption/monthly/PHqaZDuMTRvCZCvA259Z1vJu_month.csv'),\n",
|
131 |
+
" \"RZngVU6axOdshmfma0yNAajE\": pd.read_csv('data/water_consumption/monthly/RZngVU6axOdshmfma0yNAajE_month.csv'),\n",
|
132 |
+
" \"SQUOjMB6zAgYpSJEMy46tKXJ\": pd.read_csv('data/water_consumption/monthly/SQUOjMB6zAgYpSJEMy46tKXJ_month.csv'),\n",
|
133 |
+
"}\n",
|
134 |
"\n",
|
135 |
"# provide a scalar value to enable the slider to select ideal temperature\n",
|
136 |
"ideal_temperature = 50\n",
|
|
|
203 |
" html.H4('Hourly'),\n",
|
204 |
" dcc.Graph(id='water_consumption_hourly_graph')\n",
|
205 |
" ], className='six columns',\n",
|
206 |
+
" ),\n",
|
207 |
+
" html.Div(\n",
|
208 |
+
" [\n",
|
209 |
+
" html.H4('Day of the Week'),\n",
|
210 |
+
" dcc.Graph(id='water_consumption_week_day_graph')\n",
|
211 |
+
" ], className='six columns',\n",
|
212 |
+
" )\n",
|
213 |
+
" ], className='row'),\n",
|
214 |
+
" html.Div(\n",
|
215 |
+
" [\n",
|
216 |
+
" html.Div(\n",
|
217 |
+
" [\n",
|
218 |
+
" html.H4('Monthly'),\n",
|
219 |
+
" dcc.Graph(id='water_consumption_monthly_graph')\n",
|
220 |
+
" ], className='six columns',\n",
|
221 |
" )\n",
|
222 |
" ], className='row'),\n",
|
223 |
" html.Div(\n",
|
|
|
309 |
" Output('dataset-graph', 'figure'),\n",
|
310 |
" Output('water-consumption-graph', 'figure'),\n",
|
311 |
" Output('water_consumption_hourly_graph', 'figure'),\n",
|
312 |
+
" Output('water_consumption_week_day_graph', 'figure'),\n",
|
313 |
+
" Output('water_consumption_monthly_graph', 'figure'),\n",
|
314 |
" Output('solution-status', 'children'),\n",
|
315 |
" Input('dataset-dropdown', 'value'),\n",
|
316 |
" Input('solution-dropdown', 'value'),\n",
|
|
|
365 |
" water_consumption_hourly_graph.update_xaxes(title_text=\"Hour of day\")\n",
|
366 |
" water_consumption_hourly_graph.update_yaxes(title_text=\"Number of water usages\")\n",
|
367 |
"\n",
|
368 |
+
" # Water Consumption Week Day Graph\n",
|
369 |
+
" order = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']\n",
|
370 |
+
" water_consumption_df[\"datetime\"] = pd.to_datetime(water_consumption_df[\"ts\"], errors='coerce')\n",
|
371 |
+
" #create columns with day of week\n",
|
372 |
+
" water_consumption_df['day_of_week'] = water_consumption_df[\"datetime\"].apply(lambda x: x.day_name())\n",
|
373 |
+
" #turn day of week number into day of week name\n",
|
374 |
+
" #df['day_of_week'] = df['day_of_week'].apply(lambda x: calendar.day_name[x])\n",
|
375 |
+
" week_series = water_consumption_df.groupby(\"day_of_week\")[\"water_consumption_bool\"].sum().loc[order]\n",
|
376 |
+
"\n",
|
377 |
+
" # Water Consumption Week Day Graph\n",
|
378 |
+
" water_consumption_week_day_graph = go.Figure()\n",
|
379 |
+
" water_consumption_week_day_graph.add_trace(go.Bar(x=week_series.index, y=week_series.values, name='Water consumption per day of week'))\n",
|
380 |
+
" water_consumption_week_day_graph.update_layout(\n",
|
381 |
+
" title_text=\"Water consumption per day of week\"\n",
|
382 |
+
" )\n",
|
383 |
+
" water_consumption_week_day_graph.update_xaxes(title_text=\"Day of week\")\n",
|
384 |
+
" water_consumption_week_day_graph.update_yaxes(title_text=\"Number of water usages\")\n",
|
385 |
+
"\n",
|
386 |
+
" #dataset_water_consumption_monthly_dfs\n",
|
387 |
+
" #Water Consumption Monthly Graph\n",
|
388 |
+
" water_consumption_monthly_df = dataset_water_consumption_monthly_dfs[dataset]\n",
|
389 |
+
" water_consumption_monthly_graph = go.Figure()\n",
|
390 |
+
" water_consumption_monthly_graph.add_trace(go.Bar(x=water_consumption_monthly_df[\"month\"], y=water_consumption_monthly_df[\"water_consumption_bool\"], name='Water consumption per month'))\n",
|
391 |
+
" water_consumption_monthly_graph.update_layout(\n",
|
392 |
+
" title_text=\"Water consumption per month\"\n",
|
393 |
+
" )\n",
|
394 |
+
" water_consumption_monthly_graph.update_xaxes(title_text=\"Month\")\n",
|
395 |
+
" water_consumption_monthly_graph.update_yaxes(title_text=\"Number of water usages\")\n",
|
396 |
+
"\n",
|
397 |
+
"\n",
|
398 |
+
"\n",
|
399 |
"\n",
|
400 |
" # Policy Graph\n",
|
401 |
" policy_readable_graph = px.line(data, x='hour', y='policy_readable',\n",
|
|
|
443 |
" color_discrete_sequence=['green']\n",
|
444 |
" ).data[0])\n",
|
445 |
" result = \"No solution found\"\n",
|
446 |
+
" return policy_readable_graph, energy_consumption_graph, comfort_graph, dataset_graph, water_consumption_graph, water_consumption_hourly_graph, water_consumption_week_day_graph,water_consumption_monthly_graph, result\n",
|
447 |
"\n",
|
448 |
"\n",
|
449 |
"if __name__ == \"__main__\":\n",
|
app/data/water_consumption/monthly/16NSJNnjLK4MndjZYaKYGKEV_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d4b8670d9f7f691150bf68358eeab3afbd001a70fef7df19b26914183adf45b3
|
3 |
+
size 175
|
app/data/water_consumption/monthly/7uLwefnSt8CgVlmIGY8emqJK_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cb0c6582999690cad5949793b40dc8646830c2c19ee1266fc94d140ebd290134
|
3 |
+
size 176
|
app/data/water_consumption/monthly/8yS04Ddkk3pPL8e9Rku4LJtc_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0fb60977e7e19f47a3d8d21313480278cb835baf02843011c39466285b111df2
|
3 |
+
size 162
|
app/data/water_consumption/monthly/Cwp33jA19hp9VdoNJUlj6USf_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:25cd715d035ac11ae892908157b2f1bd7d82155d027a6a0a0af076ba9e254927
|
3 |
+
size 134
|
app/data/water_consumption/monthly/KN9Z3gANLftDuUGvgs8O38dI_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:49f0ae9ba922065ab283e329880ab62d0fdb4ae3ea04a676bf169ba95b9f7c40
|
3 |
+
size 178
|
app/data/water_consumption/monthly/LzbMafI31IosheUI7YGhj5at_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d7ce98eb1bc4ee4789b8221ade11ddbfc1cd6153397d603750903bb8b2e14110
|
3 |
+
size 173
|
app/data/water_consumption/monthly/PHqaZDuMTRvCZCvA259Z1vJu_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c32aaa0784b3d1a6ec1e9abb34329ac67e03df1ced0bd424fa1f60f26fd27319
|
3 |
+
size 173
|
app/data/water_consumption/monthly/RZngVU6axOdshmfma0yNAajE_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:81bb2438b07fec6e00823d9abfa7bf88367d52fcfed2ee7ea6e89765706f1508
|
3 |
+
size 175
|
app/data/water_consumption/monthly/SQUOjMB6zAgYpSJEMy46tKXJ_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c6db7792c7c1f8503390a59a84d14119d95a6b60e3e6bebe742a756f29e78ea6
|
3 |
+
size 176
|
app/data/water_consumption/monthly/UcufQVoJQPbfLzIBnSsUodJP_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0c8e778235864719e725c68949ecaabf9d8d2447e5fb07299838dc91d212df23
|
3 |
+
size 148
|
app/data/water_consumption/monthly/VTuh8oxtC6YlOCLeScXfLuY3_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f382194297855483f106fdf44d8f5b07d51fd1564c9ef3da3bcb3f278c0a7bf3
|
3 |
+
size 177
|
app/data/water_consumption/monthly/VZTnyVO3TP3ILuYsN5Xw9UR0_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3150755d0a11a1c0e7c06c97c1af36c37215af8c0451155351b7f51f8c9d0f58
|
3 |
+
size 136
|
app/data/water_consumption/monthly/WyPRjcmBXJZoC9DIURMXKxn8_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5cc0c1880ef8c2c5be2051fd89271a4374ac1ce61c01ddab28ecac4f33ef0a5f
|
3 |
+
size 149
|
app/data/water_consumption/monthly/iBFIAuvh7bCNyOQDo0jkjhRV_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:491ad4fd67cd608acaf62d4ae8e57ab1af0b38933ace627624fb7f6470d108ee
|
3 |
+
size 162
|
app/data/water_consumption/monthly/iNVKpGfGW6rU17eOtxpZSFWR_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f24705cc658941413ab2caa2f460c5ae76045ee6a6a750724d0669c83096e8a9
|
3 |
+
size 148
|
app/data/water_consumption/monthly/kaTMmHVh8gXUbHMppzdmdzpv_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0eb6a63bb72c5bd9e44e02aa3a24cdada7c65d26f810755611d1672cb732f775
|
3 |
+
size 174
|
app/data/water_consumption/monthly/yPtlbyLlDlzeBZQYrPYaByoB_month.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:98eed9898fa48623fdf7f3070b45d263a975f0e4a50ee30dcce17c870c4238f8
|
3 |
+
size 175
|