antitheft159 commited on
Commit
fa98d24
·
verified ·
1 Parent(s): 32503d2

Upload _818_electricity_demand.ipynb

Browse files
Files changed (1) hide show
  1. _818_electricity_demand.ipynb +791 -0
_818_electricity_demand.ipynb ADDED
@@ -0,0 +1,791 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 0,
4
+ "metadata": {
5
+ "colab": {
6
+ "provenance": []
7
+ },
8
+ "kernelspec": {
9
+ "name": "python3",
10
+ "display_name": "Python 3"
11
+ },
12
+ "language_info": {
13
+ "name": "python"
14
+ }
15
+ },
16
+ "cells": [
17
+ {
18
+ "cell_type": "code",
19
+ "execution_count": 1,
20
+ "metadata": {
21
+ "id": "iUlUv-HLD9cn"
22
+ },
23
+ "outputs": [],
24
+ "source": [
25
+ "import pandas as pd\n",
26
+ "df = pd.read_csv('/content/electricity.csv')"
27
+ ]
28
+ },
29
+ {
30
+ "cell_type": "code",
31
+ "source": [
32
+ "df.head()"
33
+ ],
34
+ "metadata": {
35
+ "colab": {
36
+ "base_uri": "https://localhost:8080/",
37
+ "height": 226
38
+ },
39
+ "id": "XfYIxRQUELcV",
40
+ "outputId": "9cf18efb-67c3-47e9-c6b8-f2b9cb9622f2"
41
+ },
42
+ "execution_count": 2,
43
+ "outputs": [
44
+ {
45
+ "output_type": "execute_result",
46
+ "data": {
47
+ "text/plain": [
48
+ " date day period nswprice nswdemand vicprice vicdemand transfer \\\n",
49
+ "0 0.0 b'2' 0.000000 0.056443 0.439155 0.003467 0.422915 0.414912 \n",
50
+ "1 0.0 b'2' 0.021277 0.051699 0.415055 0.003467 0.422915 0.414912 \n",
51
+ "2 0.0 b'2' 0.042553 0.051489 0.385004 0.003467 0.422915 0.414912 \n",
52
+ "3 0.0 b'2' 0.063830 0.045485 0.314639 0.003467 0.422915 0.414912 \n",
53
+ "4 0.0 b'2' 0.085106 0.042482 0.251116 0.003467 0.422915 0.414912 \n",
54
+ "\n",
55
+ " class \n",
56
+ "0 b'UP' \n",
57
+ "1 b'UP' \n",
58
+ "2 b'UP' \n",
59
+ "3 b'UP' \n",
60
+ "4 b'DOWN' "
61
+ ],
62
+ "text/html": [
63
+ "\n",
64
+ " <div id=\"df-13c5bd7f-5ace-41ba-9495-bfacdf3c4035\" class=\"colab-df-container\">\n",
65
+ " <div>\n",
66
+ "<style scoped>\n",
67
+ " .dataframe tbody tr th:only-of-type {\n",
68
+ " vertical-align: middle;\n",
69
+ " }\n",
70
+ "\n",
71
+ " .dataframe tbody tr th {\n",
72
+ " vertical-align: top;\n",
73
+ " }\n",
74
+ "\n",
75
+ " .dataframe thead th {\n",
76
+ " text-align: right;\n",
77
+ " }\n",
78
+ "</style>\n",
79
+ "<table border=\"1\" class=\"dataframe\">\n",
80
+ " <thead>\n",
81
+ " <tr style=\"text-align: right;\">\n",
82
+ " <th></th>\n",
83
+ " <th>date</th>\n",
84
+ " <th>day</th>\n",
85
+ " <th>period</th>\n",
86
+ " <th>nswprice</th>\n",
87
+ " <th>nswdemand</th>\n",
88
+ " <th>vicprice</th>\n",
89
+ " <th>vicdemand</th>\n",
90
+ " <th>transfer</th>\n",
91
+ " <th>class</th>\n",
92
+ " </tr>\n",
93
+ " </thead>\n",
94
+ " <tbody>\n",
95
+ " <tr>\n",
96
+ " <th>0</th>\n",
97
+ " <td>0.0</td>\n",
98
+ " <td>b'2'</td>\n",
99
+ " <td>0.000000</td>\n",
100
+ " <td>0.056443</td>\n",
101
+ " <td>0.439155</td>\n",
102
+ " <td>0.003467</td>\n",
103
+ " <td>0.422915</td>\n",
104
+ " <td>0.414912</td>\n",
105
+ " <td>b'UP'</td>\n",
106
+ " </tr>\n",
107
+ " <tr>\n",
108
+ " <th>1</th>\n",
109
+ " <td>0.0</td>\n",
110
+ " <td>b'2'</td>\n",
111
+ " <td>0.021277</td>\n",
112
+ " <td>0.051699</td>\n",
113
+ " <td>0.415055</td>\n",
114
+ " <td>0.003467</td>\n",
115
+ " <td>0.422915</td>\n",
116
+ " <td>0.414912</td>\n",
117
+ " <td>b'UP'</td>\n",
118
+ " </tr>\n",
119
+ " <tr>\n",
120
+ " <th>2</th>\n",
121
+ " <td>0.0</td>\n",
122
+ " <td>b'2'</td>\n",
123
+ " <td>0.042553</td>\n",
124
+ " <td>0.051489</td>\n",
125
+ " <td>0.385004</td>\n",
126
+ " <td>0.003467</td>\n",
127
+ " <td>0.422915</td>\n",
128
+ " <td>0.414912</td>\n",
129
+ " <td>b'UP'</td>\n",
130
+ " </tr>\n",
131
+ " <tr>\n",
132
+ " <th>3</th>\n",
133
+ " <td>0.0</td>\n",
134
+ " <td>b'2'</td>\n",
135
+ " <td>0.063830</td>\n",
136
+ " <td>0.045485</td>\n",
137
+ " <td>0.314639</td>\n",
138
+ " <td>0.003467</td>\n",
139
+ " <td>0.422915</td>\n",
140
+ " <td>0.414912</td>\n",
141
+ " <td>b'UP'</td>\n",
142
+ " </tr>\n",
143
+ " <tr>\n",
144
+ " <th>4</th>\n",
145
+ " <td>0.0</td>\n",
146
+ " <td>b'2'</td>\n",
147
+ " <td>0.085106</td>\n",
148
+ " <td>0.042482</td>\n",
149
+ " <td>0.251116</td>\n",
150
+ " <td>0.003467</td>\n",
151
+ " <td>0.422915</td>\n",
152
+ " <td>0.414912</td>\n",
153
+ " <td>b'DOWN'</td>\n",
154
+ " </tr>\n",
155
+ " </tbody>\n",
156
+ "</table>\n",
157
+ "</div>\n",
158
+ " <div class=\"colab-df-buttons\">\n",
159
+ "\n",
160
+ " <div class=\"colab-df-container\">\n",
161
+ " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-13c5bd7f-5ace-41ba-9495-bfacdf3c4035')\"\n",
162
+ " title=\"Convert this dataframe to an interactive table.\"\n",
163
+ " style=\"display:none;\">\n",
164
+ "\n",
165
+ " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
166
+ " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
167
+ " </svg>\n",
168
+ " </button>\n",
169
+ "\n",
170
+ " <style>\n",
171
+ " .colab-df-container {\n",
172
+ " display:flex;\n",
173
+ " gap: 12px;\n",
174
+ " }\n",
175
+ "\n",
176
+ " .colab-df-convert {\n",
177
+ " background-color: #E8F0FE;\n",
178
+ " border: none;\n",
179
+ " border-radius: 50%;\n",
180
+ " cursor: pointer;\n",
181
+ " display: none;\n",
182
+ " fill: #1967D2;\n",
183
+ " height: 32px;\n",
184
+ " padding: 0 0 0 0;\n",
185
+ " width: 32px;\n",
186
+ " }\n",
187
+ "\n",
188
+ " .colab-df-convert:hover {\n",
189
+ " background-color: #E2EBFA;\n",
190
+ " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
191
+ " fill: #174EA6;\n",
192
+ " }\n",
193
+ "\n",
194
+ " .colab-df-buttons div {\n",
195
+ " margin-bottom: 4px;\n",
196
+ " }\n",
197
+ "\n",
198
+ " [theme=dark] .colab-df-convert {\n",
199
+ " background-color: #3B4455;\n",
200
+ " fill: #D2E3FC;\n",
201
+ " }\n",
202
+ "\n",
203
+ " [theme=dark] .colab-df-convert:hover {\n",
204
+ " background-color: #434B5C;\n",
205
+ " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
206
+ " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
207
+ " fill: #FFFFFF;\n",
208
+ " }\n",
209
+ " </style>\n",
210
+ "\n",
211
+ " <script>\n",
212
+ " const buttonEl =\n",
213
+ " document.querySelector('#df-13c5bd7f-5ace-41ba-9495-bfacdf3c4035 button.colab-df-convert');\n",
214
+ " buttonEl.style.display =\n",
215
+ " google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
216
+ "\n",
217
+ " async function convertToInteractive(key) {\n",
218
+ " const element = document.querySelector('#df-13c5bd7f-5ace-41ba-9495-bfacdf3c4035');\n",
219
+ " const dataTable =\n",
220
+ " await google.colab.kernel.invokeFunction('convertToInteractive',\n",
221
+ " [key], {});\n",
222
+ " if (!dataTable) return;\n",
223
+ "\n",
224
+ " const docLinkHtml = 'Like what you see? Visit the ' +\n",
225
+ " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
226
+ " + ' to learn more about interactive tables.';\n",
227
+ " element.innerHTML = '';\n",
228
+ " dataTable['output_type'] = 'display_data';\n",
229
+ " await google.colab.output.renderOutput(dataTable, element);\n",
230
+ " const docLink = document.createElement('div');\n",
231
+ " docLink.innerHTML = docLinkHtml;\n",
232
+ " element.appendChild(docLink);\n",
233
+ " }\n",
234
+ " </script>\n",
235
+ " </div>\n",
236
+ "\n",
237
+ "\n",
238
+ "<div id=\"df-c8934099-18e0-4cfa-8043-1e260a9007ce\">\n",
239
+ " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-c8934099-18e0-4cfa-8043-1e260a9007ce')\"\n",
240
+ " title=\"Suggest charts\"\n",
241
+ " style=\"display:none;\">\n",
242
+ "\n",
243
+ "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
244
+ " width=\"24px\">\n",
245
+ " <g>\n",
246
+ " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
247
+ " </g>\n",
248
+ "</svg>\n",
249
+ " </button>\n",
250
+ "\n",
251
+ "<style>\n",
252
+ " .colab-df-quickchart {\n",
253
+ " --bg-color: #E8F0FE;\n",
254
+ " --fill-color: #1967D2;\n",
255
+ " --hover-bg-color: #E2EBFA;\n",
256
+ " --hover-fill-color: #174EA6;\n",
257
+ " --disabled-fill-color: #AAA;\n",
258
+ " --disabled-bg-color: #DDD;\n",
259
+ " }\n",
260
+ "\n",
261
+ " [theme=dark] .colab-df-quickchart {\n",
262
+ " --bg-color: #3B4455;\n",
263
+ " --fill-color: #D2E3FC;\n",
264
+ " --hover-bg-color: #434B5C;\n",
265
+ " --hover-fill-color: #FFFFFF;\n",
266
+ " --disabled-bg-color: #3B4455;\n",
267
+ " --disabled-fill-color: #666;\n",
268
+ " }\n",
269
+ "\n",
270
+ " .colab-df-quickchart {\n",
271
+ " background-color: var(--bg-color);\n",
272
+ " border: none;\n",
273
+ " border-radius: 50%;\n",
274
+ " cursor: pointer;\n",
275
+ " display: none;\n",
276
+ " fill: var(--fill-color);\n",
277
+ " height: 32px;\n",
278
+ " padding: 0;\n",
279
+ " width: 32px;\n",
280
+ " }\n",
281
+ "\n",
282
+ " .colab-df-quickchart:hover {\n",
283
+ " background-color: var(--hover-bg-color);\n",
284
+ " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
285
+ " fill: var(--button-hover-fill-color);\n",
286
+ " }\n",
287
+ "\n",
288
+ " .colab-df-quickchart-complete:disabled,\n",
289
+ " .colab-df-quickchart-complete:disabled:hover {\n",
290
+ " background-color: var(--disabled-bg-color);\n",
291
+ " fill: var(--disabled-fill-color);\n",
292
+ " box-shadow: none;\n",
293
+ " }\n",
294
+ "\n",
295
+ " .colab-df-spinner {\n",
296
+ " border: 2px solid var(--fill-color);\n",
297
+ " border-color: transparent;\n",
298
+ " border-bottom-color: var(--fill-color);\n",
299
+ " animation:\n",
300
+ " spin 1s steps(1) infinite;\n",
301
+ " }\n",
302
+ "\n",
303
+ " @keyframes spin {\n",
304
+ " 0% {\n",
305
+ " border-color: transparent;\n",
306
+ " border-bottom-color: var(--fill-color);\n",
307
+ " border-left-color: var(--fill-color);\n",
308
+ " }\n",
309
+ " 20% {\n",
310
+ " border-color: transparent;\n",
311
+ " border-left-color: var(--fill-color);\n",
312
+ " border-top-color: var(--fill-color);\n",
313
+ " }\n",
314
+ " 30% {\n",
315
+ " border-color: transparent;\n",
316
+ " border-left-color: var(--fill-color);\n",
317
+ " border-top-color: var(--fill-color);\n",
318
+ " border-right-color: var(--fill-color);\n",
319
+ " }\n",
320
+ " 40% {\n",
321
+ " border-color: transparent;\n",
322
+ " border-right-color: var(--fill-color);\n",
323
+ " border-top-color: var(--fill-color);\n",
324
+ " }\n",
325
+ " 60% {\n",
326
+ " border-color: transparent;\n",
327
+ " border-right-color: var(--fill-color);\n",
328
+ " }\n",
329
+ " 80% {\n",
330
+ " border-color: transparent;\n",
331
+ " border-right-color: var(--fill-color);\n",
332
+ " border-bottom-color: var(--fill-color);\n",
333
+ " }\n",
334
+ " 90% {\n",
335
+ " border-color: transparent;\n",
336
+ " border-bottom-color: var(--fill-color);\n",
337
+ " }\n",
338
+ " }\n",
339
+ "</style>\n",
340
+ "\n",
341
+ " <script>\n",
342
+ " async function quickchart(key) {\n",
343
+ " const quickchartButtonEl =\n",
344
+ " document.querySelector('#' + key + ' button');\n",
345
+ " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
346
+ " quickchartButtonEl.classList.add('colab-df-spinner');\n",
347
+ " try {\n",
348
+ " const charts = await google.colab.kernel.invokeFunction(\n",
349
+ " 'suggestCharts', [key], {});\n",
350
+ " } catch (error) {\n",
351
+ " console.error('Error during call to suggestCharts:', error);\n",
352
+ " }\n",
353
+ " quickchartButtonEl.classList.remove('colab-df-spinner');\n",
354
+ " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
355
+ " }\n",
356
+ " (() => {\n",
357
+ " let quickchartButtonEl =\n",
358
+ " document.querySelector('#df-c8934099-18e0-4cfa-8043-1e260a9007ce button');\n",
359
+ " quickchartButtonEl.style.display =\n",
360
+ " google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
361
+ " })();\n",
362
+ " </script>\n",
363
+ "</div>\n",
364
+ "\n",
365
+ " </div>\n",
366
+ " </div>\n"
367
+ ],
368
+ "application/vnd.google.colaboratory.intrinsic+json": {
369
+ "type": "dataframe",
370
+ "variable_name": "df",
371
+ "summary": "{\n \"name\": \"df\",\n \"rows\": 45312,\n \"fields\": [\n {\n \"column\": \"date\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.34030772179030583,\n \"min\": 0.0,\n \"max\": 1.0,\n \"num_unique_values\": 933,\n \"samples\": [\n 0.89881,\n 0.009247,\n 0.868192\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"day\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 7,\n \"samples\": [\n \"b'2'\",\n \"b'3'\",\n \"b'7'\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"period\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.2947563828038936,\n \"min\": 0.0,\n \"max\": 1.0,\n \"num_unique_values\": 48,\n \"samples\": [\n 0.574468,\n 0.851064,\n 0.553191\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"nswprice\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.039990768954021906,\n \"min\": 0.0,\n \"max\": 1.0,\n \"num_unique_values\": 4089,\n \"samples\": [\n 0.092801,\n 0.11838,\n 0.11832\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"nswdemand\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.1633227141782043,\n \"min\": 0.0,\n \"max\": 1.0,\n \"num_unique_values\": 5266,\n \"samples\": [\n 0.677626,\n 0.778637,\n 0.196519\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"vicprice\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.010213038212794925,\n \"min\": 0.0,\n \"max\": 1.0,\n \"num_unique_values\": 3798,\n \"samples\": [\n 0.004614,\n 0.003874,\n 0.002987\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"vicdemand\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.12096534549179237,\n \"min\": 0.0,\n \"max\": 1.0,\n \"num_unique_values\": 2846,\n \"samples\": [\n 0.719834,\n 0.225531,\n 0.493268\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"transfer\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.1533733911366238,\n \"min\": 0.0,\n \"max\": 1.0,\n \"num_unique_values\": 1878,\n \"samples\": [\n 0.820614,\n 0.239035,\n 0.832456\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"class\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"b'DOWN'\",\n \"b'UP'\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"
372
+ }
373
+ },
374
+ "metadata": {},
375
+ "execution_count": 2
376
+ }
377
+ ]
378
+ },
379
+ {
380
+ "cell_type": "code",
381
+ "source": [
382
+ "df.info()"
383
+ ],
384
+ "metadata": {
385
+ "colab": {
386
+ "base_uri": "https://localhost:8080/"
387
+ },
388
+ "id": "fEnQSpcUENgi",
389
+ "outputId": "018013d1-274f-47a9-8c1c-1b2dfbe58d2d"
390
+ },
391
+ "execution_count": 3,
392
+ "outputs": [
393
+ {
394
+ "output_type": "stream",
395
+ "name": "stdout",
396
+ "text": [
397
+ "<class 'pandas.core.frame.DataFrame'>\n",
398
+ "RangeIndex: 45312 entries, 0 to 45311\n",
399
+ "Data columns (total 9 columns):\n",
400
+ " # Column Non-Null Count Dtype \n",
401
+ "--- ------ -------------- ----- \n",
402
+ " 0 date 45312 non-null float64\n",
403
+ " 1 day 45312 non-null object \n",
404
+ " 2 period 45312 non-null float64\n",
405
+ " 3 nswprice 45312 non-null float64\n",
406
+ " 4 nswdemand 45312 non-null float64\n",
407
+ " 5 vicprice 45312 non-null float64\n",
408
+ " 6 vicdemand 45312 non-null float64\n",
409
+ " 7 transfer 45312 non-null float64\n",
410
+ " 8 class 45312 non-null object \n",
411
+ "dtypes: float64(7), object(2)\n",
412
+ "memory usage: 3.1+ MB\n"
413
+ ]
414
+ }
415
+ ]
416
+ },
417
+ {
418
+ "cell_type": "code",
419
+ "source": [
420
+ "df.describe()"
421
+ ],
422
+ "metadata": {
423
+ "colab": {
424
+ "base_uri": "https://localhost:8080/",
425
+ "height": 320
426
+ },
427
+ "id": "U_kqvcdpEPCe",
428
+ "outputId": "db63b846-ea80-4924-8298-14e8fb5c7178"
429
+ },
430
+ "execution_count": 4,
431
+ "outputs": [
432
+ {
433
+ "output_type": "execute_result",
434
+ "data": {
435
+ "text/plain": [
436
+ " date period nswprice nswdemand vicprice \\\n",
437
+ "count 45312.000000 45312.000000 45312.000000 45312.000000 45312.000000 \n",
438
+ "mean 0.499080 0.500000 0.057868 0.425418 0.003467 \n",
439
+ "std 0.340308 0.294756 0.039991 0.163323 0.010213 \n",
440
+ "min 0.000000 0.000000 0.000000 0.000000 0.000000 \n",
441
+ "25% 0.031934 0.250000 0.035127 0.309134 0.002277 \n",
442
+ "50% 0.456329 0.500000 0.048652 0.443693 0.003467 \n",
443
+ "75% 0.880547 0.750000 0.074336 0.536001 0.003467 \n",
444
+ "max 1.000000 1.000000 1.000000 1.000000 1.000000 \n",
445
+ "\n",
446
+ " vicdemand transfer \n",
447
+ "count 45312.000000 45312.000000 \n",
448
+ "mean 0.422915 0.500526 \n",
449
+ "std 0.120965 0.153373 \n",
450
+ "min 0.000000 0.000000 \n",
451
+ "25% 0.372346 0.414912 \n",
452
+ "50% 0.422915 0.414912 \n",
453
+ "75% 0.469252 0.605702 \n",
454
+ "max 1.000000 1.000000 "
455
+ ],
456
+ "text/html": [
457
+ "\n",
458
+ " <div id=\"df-0acdcb62-809a-4cbd-9030-351eca65d247\" class=\"colab-df-container\">\n",
459
+ " <div>\n",
460
+ "<style scoped>\n",
461
+ " .dataframe tbody tr th:only-of-type {\n",
462
+ " vertical-align: middle;\n",
463
+ " }\n",
464
+ "\n",
465
+ " .dataframe tbody tr th {\n",
466
+ " vertical-align: top;\n",
467
+ " }\n",
468
+ "\n",
469
+ " .dataframe thead th {\n",
470
+ " text-align: right;\n",
471
+ " }\n",
472
+ "</style>\n",
473
+ "<table border=\"1\" class=\"dataframe\">\n",
474
+ " <thead>\n",
475
+ " <tr style=\"text-align: right;\">\n",
476
+ " <th></th>\n",
477
+ " <th>date</th>\n",
478
+ " <th>period</th>\n",
479
+ " <th>nswprice</th>\n",
480
+ " <th>nswdemand</th>\n",
481
+ " <th>vicprice</th>\n",
482
+ " <th>vicdemand</th>\n",
483
+ " <th>transfer</th>\n",
484
+ " </tr>\n",
485
+ " </thead>\n",
486
+ " <tbody>\n",
487
+ " <tr>\n",
488
+ " <th>count</th>\n",
489
+ " <td>45312.000000</td>\n",
490
+ " <td>45312.000000</td>\n",
491
+ " <td>45312.000000</td>\n",
492
+ " <td>45312.000000</td>\n",
493
+ " <td>45312.000000</td>\n",
494
+ " <td>45312.000000</td>\n",
495
+ " <td>45312.000000</td>\n",
496
+ " </tr>\n",
497
+ " <tr>\n",
498
+ " <th>mean</th>\n",
499
+ " <td>0.499080</td>\n",
500
+ " <td>0.500000</td>\n",
501
+ " <td>0.057868</td>\n",
502
+ " <td>0.425418</td>\n",
503
+ " <td>0.003467</td>\n",
504
+ " <td>0.422915</td>\n",
505
+ " <td>0.500526</td>\n",
506
+ " </tr>\n",
507
+ " <tr>\n",
508
+ " <th>std</th>\n",
509
+ " <td>0.340308</td>\n",
510
+ " <td>0.294756</td>\n",
511
+ " <td>0.039991</td>\n",
512
+ " <td>0.163323</td>\n",
513
+ " <td>0.010213</td>\n",
514
+ " <td>0.120965</td>\n",
515
+ " <td>0.153373</td>\n",
516
+ " </tr>\n",
517
+ " <tr>\n",
518
+ " <th>min</th>\n",
519
+ " <td>0.000000</td>\n",
520
+ " <td>0.000000</td>\n",
521
+ " <td>0.000000</td>\n",
522
+ " <td>0.000000</td>\n",
523
+ " <td>0.000000</td>\n",
524
+ " <td>0.000000</td>\n",
525
+ " <td>0.000000</td>\n",
526
+ " </tr>\n",
527
+ " <tr>\n",
528
+ " <th>25%</th>\n",
529
+ " <td>0.031934</td>\n",
530
+ " <td>0.250000</td>\n",
531
+ " <td>0.035127</td>\n",
532
+ " <td>0.309134</td>\n",
533
+ " <td>0.002277</td>\n",
534
+ " <td>0.372346</td>\n",
535
+ " <td>0.414912</td>\n",
536
+ " </tr>\n",
537
+ " <tr>\n",
538
+ " <th>50%</th>\n",
539
+ " <td>0.456329</td>\n",
540
+ " <td>0.500000</td>\n",
541
+ " <td>0.048652</td>\n",
542
+ " <td>0.443693</td>\n",
543
+ " <td>0.003467</td>\n",
544
+ " <td>0.422915</td>\n",
545
+ " <td>0.414912</td>\n",
546
+ " </tr>\n",
547
+ " <tr>\n",
548
+ " <th>75%</th>\n",
549
+ " <td>0.880547</td>\n",
550
+ " <td>0.750000</td>\n",
551
+ " <td>0.074336</td>\n",
552
+ " <td>0.536001</td>\n",
553
+ " <td>0.003467</td>\n",
554
+ " <td>0.469252</td>\n",
555
+ " <td>0.605702</td>\n",
556
+ " </tr>\n",
557
+ " <tr>\n",
558
+ " <th>max</th>\n",
559
+ " <td>1.000000</td>\n",
560
+ " <td>1.000000</td>\n",
561
+ " <td>1.000000</td>\n",
562
+ " <td>1.000000</td>\n",
563
+ " <td>1.000000</td>\n",
564
+ " <td>1.000000</td>\n",
565
+ " <td>1.000000</td>\n",
566
+ " </tr>\n",
567
+ " </tbody>\n",
568
+ "</table>\n",
569
+ "</div>\n",
570
+ " <div class=\"colab-df-buttons\">\n",
571
+ "\n",
572
+ " <div class=\"colab-df-container\">\n",
573
+ " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-0acdcb62-809a-4cbd-9030-351eca65d247')\"\n",
574
+ " title=\"Convert this dataframe to an interactive table.\"\n",
575
+ " style=\"display:none;\">\n",
576
+ "\n",
577
+ " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
578
+ " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
579
+ " </svg>\n",
580
+ " </button>\n",
581
+ "\n",
582
+ " <style>\n",
583
+ " .colab-df-container {\n",
584
+ " display:flex;\n",
585
+ " gap: 12px;\n",
586
+ " }\n",
587
+ "\n",
588
+ " .colab-df-convert {\n",
589
+ " background-color: #E8F0FE;\n",
590
+ " border: none;\n",
591
+ " border-radius: 50%;\n",
592
+ " cursor: pointer;\n",
593
+ " display: none;\n",
594
+ " fill: #1967D2;\n",
595
+ " height: 32px;\n",
596
+ " padding: 0 0 0 0;\n",
597
+ " width: 32px;\n",
598
+ " }\n",
599
+ "\n",
600
+ " .colab-df-convert:hover {\n",
601
+ " background-color: #E2EBFA;\n",
602
+ " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
603
+ " fill: #174EA6;\n",
604
+ " }\n",
605
+ "\n",
606
+ " .colab-df-buttons div {\n",
607
+ " margin-bottom: 4px;\n",
608
+ " }\n",
609
+ "\n",
610
+ " [theme=dark] .colab-df-convert {\n",
611
+ " background-color: #3B4455;\n",
612
+ " fill: #D2E3FC;\n",
613
+ " }\n",
614
+ "\n",
615
+ " [theme=dark] .colab-df-convert:hover {\n",
616
+ " background-color: #434B5C;\n",
617
+ " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
618
+ " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
619
+ " fill: #FFFFFF;\n",
620
+ " }\n",
621
+ " </style>\n",
622
+ "\n",
623
+ " <script>\n",
624
+ " const buttonEl =\n",
625
+ " document.querySelector('#df-0acdcb62-809a-4cbd-9030-351eca65d247 button.colab-df-convert');\n",
626
+ " buttonEl.style.display =\n",
627
+ " google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
628
+ "\n",
629
+ " async function convertToInteractive(key) {\n",
630
+ " const element = document.querySelector('#df-0acdcb62-809a-4cbd-9030-351eca65d247');\n",
631
+ " const dataTable =\n",
632
+ " await google.colab.kernel.invokeFunction('convertToInteractive',\n",
633
+ " [key], {});\n",
634
+ " if (!dataTable) return;\n",
635
+ "\n",
636
+ " const docLinkHtml = 'Like what you see? Visit the ' +\n",
637
+ " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
638
+ " + ' to learn more about interactive tables.';\n",
639
+ " element.innerHTML = '';\n",
640
+ " dataTable['output_type'] = 'display_data';\n",
641
+ " await google.colab.output.renderOutput(dataTable, element);\n",
642
+ " const docLink = document.createElement('div');\n",
643
+ " docLink.innerHTML = docLinkHtml;\n",
644
+ " element.appendChild(docLink);\n",
645
+ " }\n",
646
+ " </script>\n",
647
+ " </div>\n",
648
+ "\n",
649
+ "\n",
650
+ "<div id=\"df-d90ab044-465f-4e94-86cb-66993343c124\">\n",
651
+ " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-d90ab044-465f-4e94-86cb-66993343c124')\"\n",
652
+ " title=\"Suggest charts\"\n",
653
+ " style=\"display:none;\">\n",
654
+ "\n",
655
+ "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
656
+ " width=\"24px\">\n",
657
+ " <g>\n",
658
+ " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
659
+ " </g>\n",
660
+ "</svg>\n",
661
+ " </button>\n",
662
+ "\n",
663
+ "<style>\n",
664
+ " .colab-df-quickchart {\n",
665
+ " --bg-color: #E8F0FE;\n",
666
+ " --fill-color: #1967D2;\n",
667
+ " --hover-bg-color: #E2EBFA;\n",
668
+ " --hover-fill-color: #174EA6;\n",
669
+ " --disabled-fill-color: #AAA;\n",
670
+ " --disabled-bg-color: #DDD;\n",
671
+ " }\n",
672
+ "\n",
673
+ " [theme=dark] .colab-df-quickchart {\n",
674
+ " --bg-color: #3B4455;\n",
675
+ " --fill-color: #D2E3FC;\n",
676
+ " --hover-bg-color: #434B5C;\n",
677
+ " --hover-fill-color: #FFFFFF;\n",
678
+ " --disabled-bg-color: #3B4455;\n",
679
+ " --disabled-fill-color: #666;\n",
680
+ " }\n",
681
+ "\n",
682
+ " .colab-df-quickchart {\n",
683
+ " background-color: var(--bg-color);\n",
684
+ " border: none;\n",
685
+ " border-radius: 50%;\n",
686
+ " cursor: pointer;\n",
687
+ " display: none;\n",
688
+ " fill: var(--fill-color);\n",
689
+ " height: 32px;\n",
690
+ " padding: 0;\n",
691
+ " width: 32px;\n",
692
+ " }\n",
693
+ "\n",
694
+ " .colab-df-quickchart:hover {\n",
695
+ " background-color: var(--hover-bg-color);\n",
696
+ " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
697
+ " fill: var(--button-hover-fill-color);\n",
698
+ " }\n",
699
+ "\n",
700
+ " .colab-df-quickchart-complete:disabled,\n",
701
+ " .colab-df-quickchart-complete:disabled:hover {\n",
702
+ " background-color: var(--disabled-bg-color);\n",
703
+ " fill: var(--disabled-fill-color);\n",
704
+ " box-shadow: none;\n",
705
+ " }\n",
706
+ "\n",
707
+ " .colab-df-spinner {\n",
708
+ " border: 2px solid var(--fill-color);\n",
709
+ " border-color: transparent;\n",
710
+ " border-bottom-color: var(--fill-color);\n",
711
+ " animation:\n",
712
+ " spin 1s steps(1) infinite;\n",
713
+ " }\n",
714
+ "\n",
715
+ " @keyframes spin {\n",
716
+ " 0% {\n",
717
+ " border-color: transparent;\n",
718
+ " border-bottom-color: var(--fill-color);\n",
719
+ " border-left-color: var(--fill-color);\n",
720
+ " }\n",
721
+ " 20% {\n",
722
+ " border-color: transparent;\n",
723
+ " border-left-color: var(--fill-color);\n",
724
+ " border-top-color: var(--fill-color);\n",
725
+ " }\n",
726
+ " 30% {\n",
727
+ " border-color: transparent;\n",
728
+ " border-left-color: var(--fill-color);\n",
729
+ " border-top-color: var(--fill-color);\n",
730
+ " border-right-color: var(--fill-color);\n",
731
+ " }\n",
732
+ " 40% {\n",
733
+ " border-color: transparent;\n",
734
+ " border-right-color: var(--fill-color);\n",
735
+ " border-top-color: var(--fill-color);\n",
736
+ " }\n",
737
+ " 60% {\n",
738
+ " border-color: transparent;\n",
739
+ " border-right-color: var(--fill-color);\n",
740
+ " }\n",
741
+ " 80% {\n",
742
+ " border-color: transparent;\n",
743
+ " border-right-color: var(--fill-color);\n",
744
+ " border-bottom-color: var(--fill-color);\n",
745
+ " }\n",
746
+ " 90% {\n",
747
+ " border-color: transparent;\n",
748
+ " border-bottom-color: var(--fill-color);\n",
749
+ " }\n",
750
+ " }\n",
751
+ "</style>\n",
752
+ "\n",
753
+ " <script>\n",
754
+ " async function quickchart(key) {\n",
755
+ " const quickchartButtonEl =\n",
756
+ " document.querySelector('#' + key + ' button');\n",
757
+ " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
758
+ " quickchartButtonEl.classList.add('colab-df-spinner');\n",
759
+ " try {\n",
760
+ " const charts = await google.colab.kernel.invokeFunction(\n",
761
+ " 'suggestCharts', [key], {});\n",
762
+ " } catch (error) {\n",
763
+ " console.error('Error during call to suggestCharts:', error);\n",
764
+ " }\n",
765
+ " quickchartButtonEl.classList.remove('colab-df-spinner');\n",
766
+ " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
767
+ " }\n",
768
+ " (() => {\n",
769
+ " let quickchartButtonEl =\n",
770
+ " document.querySelector('#df-d90ab044-465f-4e94-86cb-66993343c124 button');\n",
771
+ " quickchartButtonEl.style.display =\n",
772
+ " google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
773
+ " })();\n",
774
+ " </script>\n",
775
+ "</div>\n",
776
+ "\n",
777
+ " </div>\n",
778
+ " </div>\n"
779
+ ],
780
+ "application/vnd.google.colaboratory.intrinsic+json": {
781
+ "type": "dataframe",
782
+ "summary": "{\n \"name\": \"df\",\n \"rows\": 8,\n \"fields\": [\n {\n \"column\": \"date\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 16020.049200037409,\n \"min\": 0.0,\n \"max\": 45312.0,\n \"num_unique_values\": 8,\n \"samples\": [\n 0.4990795572033898,\n 0.456329,\n 45312.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"period\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 16020.04482718291,\n \"min\": 0.0,\n \"max\": 45312.0,\n \"num_unique_values\": 7,\n \"samples\": [\n 45312.0,\n 0.5,\n 0.75\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"nswprice\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 16020.147801808478,\n \"min\": 0.0,\n \"max\": 45312.0,\n \"num_unique_values\": 8,\n \"samples\": [\n 0.057868310138594635,\n 0.048652,\n 45312.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"nswdemand\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 16020.06589812015,\n \"min\": 0.0,\n \"max\": 45312.0,\n \"num_unique_values\": 8,\n \"samples\": [\n 0.42541789525953394,\n 0.44369250000000005,\n 45312.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"vicprice\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 16020.159574554327,\n \"min\": 0.0,\n \"max\": 45312.0,\n \"num_unique_values\": 7,\n \"samples\": [\n 45312.0,\n 0.003467033898305085,\n 0.003467\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"vicdemand\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 16020.069391982126,\n \"min\": 0.0,\n \"max\": 45312.0,\n \"num_unique_values\": 8,\n \"samples\": [\n 0.4229150757194562,\n 0.422915,\n 45312.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"transfer\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 16020.055197768741,\n \"min\": 0.0,\n \"max\": 45312.0,\n \"num_unique_values\": 7,\n \"samples\": [\n 45312.0,\n 0.5005263909118999,\n 0.605702\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"
783
+ }
784
+ },
785
+ "metadata": {},
786
+ "execution_count": 4
787
+ }
788
+ ]
789
+ }
790
+ ]
791
+ }