Parse heat demand csv.ipynb 17.6 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d2c68f35",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "66f2a037",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv(r\"C:\\Users\\eric.duminil\\git\\simstadt2\\TestRepository\\Gruenbuehl.proj\\99_HeatDemand.flow\\04_MonthlyEnergyBalance.step\\Gruenbuehl_LOD2_ALKIS_1010_DIN18599_HEATING.csv\",\n",
    "            skiprows=list(range(19)) + [20],\n",
    "            sep=';',\n",
    "            decimal=','\n",
    "           )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "c94d6456",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>GMLId</th>\n",
       "      <th>ParentGMLId</th>\n",
       "      <th>Latitude</th>\n",
       "      <th>Longitude</th>\n",
       "      <th>X-coordinate</th>\n",
       "      <th>Y-coordinate</th>\n",
       "      <th>LOD</th>\n",
       "      <th>Year of construction</th>\n",
       "      <th>Year of refurbishment</th>\n",
       "      <th>Refurbishment Variant</th>\n",
       "      <th>...</th>\n",
       "      <th>March Heating demand</th>\n",
       "      <th>April Heating demand</th>\n",
       "      <th>May Heating demand</th>\n",
       "      <th>June Heating demand</th>\n",
       "      <th>July Heating demand</th>\n",
       "      <th>August Heating demand</th>\n",
       "      <th>September Heating demand</th>\n",
       "      <th>October Heating demand</th>\n",
       "      <th>November Heating demand</th>\n",
       "      <th>December Heating demand</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>DEBW_LOD2_1004495</td>\n",
       "      <td>NaN</td>\n",
       "      <td>48.87950</td>\n",
       "      <td>9.21478</td>\n",
       "      <td>3515829.63</td>\n",
       "      <td>5415809.40</td>\n",
       "      <td>LOD_2</td>\n",
       "      <td>1968</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Original</td>\n",
       "      <td>...</td>\n",
       "      <td>15987</td>\n",
       "      <td>4566</td>\n",
       "      <td>673</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>690</td>\n",
       "      <td>8449</td>\n",
       "      <td>19075</td>\n",
       "      <td>26508</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>DEBW_LOD2_1004496</td>\n",
       "      <td>NaN</td>\n",
       "      <td>48.87939</td>\n",
       "      <td>9.21456</td>\n",
       "      <td>3515813.56</td>\n",
       "      <td>5415796.91</td>\n",
       "      <td>LOD_2</td>\n",
       "      <td>1968</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Original</td>\n",
       "      <td>...</td>\n",
       "      <td>3973</td>\n",
       "      <td>1011</td>\n",
       "      <td>117</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>120</td>\n",
       "      <td>2085</td>\n",
       "      <td>4933</td>\n",
       "      <td>6905</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>DEBW_LOD2_1003853</td>\n",
       "      <td>NaN</td>\n",
       "      <td>48.87800</td>\n",
       "      <td>9.21559</td>\n",
       "      <td>3515888.84</td>\n",
       "      <td>5415642.86</td>\n",
       "      <td>LOD_2</td>\n",
       "      <td>1968</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Original</td>\n",
       "      <td>...</td>\n",
       "      <td>2998</td>\n",
       "      <td>868</td>\n",
       "      <td>125</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>120</td>\n",
       "      <td>1578</td>\n",
       "      <td>3597</td>\n",
       "      <td>5006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>DEBW_LOD2_1003651</td>\n",
       "      <td>NaN</td>\n",
       "      <td>48.87778</td>\n",
       "      <td>9.21467</td>\n",
       "      <td>3515821.59</td>\n",
       "      <td>5415617.69</td>\n",
       "      <td>LOD_2</td>\n",
       "      <td>1957</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Original</td>\n",
       "      <td>...</td>\n",
       "      <td>11847</td>\n",
       "      <td>2785</td>\n",
       "      <td>333</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>401</td>\n",
       "      <td>6428</td>\n",
       "      <td>15161</td>\n",
       "      <td>21212</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>DEBW_LOD2_1003854</td>\n",
       "      <td>NaN</td>\n",
       "      <td>48.87811</td>\n",
       "      <td>9.21559</td>\n",
       "      <td>3515889.08</td>\n",
       "      <td>5415655.22</td>\n",
       "      <td>LOD_2</td>\n",
       "      <td>1968</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Original</td>\n",
       "      <td>...</td>\n",
       "      <td>3669</td>\n",
       "      <td>1102</td>\n",
       "      <td>154</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>140</td>\n",
       "      <td>1938</td>\n",
       "      <td>4310</td>\n",
       "      <td>5964</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>100</th>\n",
       "      <td>DEBW_LOD2_2158</td>\n",
       "      <td>NaN</td>\n",
       "      <td>48.87861</td>\n",
       "      <td>9.21813</td>\n",
       "      <td>3516075.53</td>\n",
       "      <td>5415710.81</td>\n",
       "      <td>LOD_2</td>\n",
       "      <td>1968</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Original</td>\n",
       "      <td>...</td>\n",
       "      <td>8581</td>\n",
       "      <td>2153</td>\n",
       "      <td>289</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>286</td>\n",
       "      <td>4447</td>\n",
       "      <td>10780</td>\n",
       "      <td>15176</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>101</th>\n",
       "      <td>DEBW_LOD2_2200</td>\n",
       "      <td>NaN</td>\n",
       "      <td>48.87856</td>\n",
       "      <td>9.21908</td>\n",
       "      <td>3516145.22</td>\n",
       "      <td>5415705.71</td>\n",
       "      <td>LOD_2</td>\n",
       "      <td>1994</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Original</td>\n",
       "      <td>...</td>\n",
       "      <td>15099</td>\n",
       "      <td>2708</td>\n",
       "      <td>207</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>295</td>\n",
       "      <td>7775</td>\n",
       "      <td>20013</td>\n",
       "      <td>28298</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>102</th>\n",
       "      <td>DEBW_LOD2_2147</td>\n",
       "      <td>NaN</td>\n",
       "      <td>48.87856</td>\n",
       "      <td>9.21771</td>\n",
       "      <td>3516044.74</td>\n",
       "      <td>5415705.26</td>\n",
       "      <td>LOD_2</td>\n",
       "      <td>1968</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Original</td>\n",
       "      <td>...</td>\n",
       "      <td>8622</td>\n",
       "      <td>2174</td>\n",
       "      <td>298</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>292</td>\n",
       "      <td>4476</td>\n",
       "      <td>10820</td>\n",
       "      <td>15219</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>103</th>\n",
       "      <td>DEBW_LOD2_2146</td>\n",
       "      <td>NaN</td>\n",
       "      <td>48.87869</td>\n",
       "      <td>9.21771</td>\n",
       "      <td>3516044.42</td>\n",
       "      <td>5415719.66</td>\n",
       "      <td>LOD_2</td>\n",
       "      <td>1968</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Original</td>\n",
       "      <td>...</td>\n",
       "      <td>6895</td>\n",
       "      <td>1762</td>\n",
       "      <td>226</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>284</td>\n",
       "      <td>3871</td>\n",
       "      <td>8580</td>\n",
       "      <td>11813</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>104</th>\n",
       "      <td>DEBW_LOD2_1249</td>\n",
       "      <td>NaN</td>\n",
       "      <td>48.87922</td>\n",
       "      <td>9.21722</td>\n",
       "      <td>3516008.53</td>\n",
       "      <td>5415779.04</td>\n",
       "      <td>LOD_2</td>\n",
       "      <td>1968</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Original</td>\n",
       "      <td>...</td>\n",
       "      <td>7505</td>\n",
       "      <td>1981</td>\n",
       "      <td>254</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>307</td>\n",
       "      <td>4159</td>\n",
       "      <td>9307</td>\n",
       "      <td>12859</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>105 rows × 54 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                 GMLId  ParentGMLId  Latitude  Longitude  X-coordinate  \\\n",
       "0    DEBW_LOD2_1004495          NaN  48.87950    9.21478    3515829.63   \n",
       "1    DEBW_LOD2_1004496          NaN  48.87939    9.21456    3515813.56   \n",
       "2    DEBW_LOD2_1003853          NaN  48.87800    9.21559    3515888.84   \n",
       "3    DEBW_LOD2_1003651          NaN  48.87778    9.21467    3515821.59   \n",
       "4    DEBW_LOD2_1003854          NaN  48.87811    9.21559    3515889.08   \n",
       "..                 ...          ...       ...        ...           ...   \n",
       "100     DEBW_LOD2_2158          NaN  48.87861    9.21813    3516075.53   \n",
       "101     DEBW_LOD2_2200          NaN  48.87856    9.21908    3516145.22   \n",
       "102     DEBW_LOD2_2147          NaN  48.87856    9.21771    3516044.74   \n",
       "103     DEBW_LOD2_2146          NaN  48.87869    9.21771    3516044.42   \n",
       "104     DEBW_LOD2_1249          NaN  48.87922    9.21722    3516008.53   \n",
       "\n",
       "     Y-coordinate    LOD  Year of construction  Year of refurbishment  \\\n",
       "0      5415809.40  LOD_2                  1968                    NaN   \n",
       "1      5415796.91  LOD_2                  1968                    NaN   \n",
       "2      5415642.86  LOD_2                  1968                    NaN   \n",
       "3      5415617.69  LOD_2                  1957                    NaN   \n",
       "4      5415655.22  LOD_2                  1968                    NaN   \n",
       "..            ...    ...                   ...                    ...   \n",
       "100    5415710.81  LOD_2                  1968                    NaN   \n",
       "101    5415705.71  LOD_2                  1994                    NaN   \n",
       "102    5415705.26  LOD_2                  1968                    NaN   \n",
       "103    5415719.66  LOD_2                  1968                    NaN   \n",
       "104    5415779.04  LOD_2                  1968                    NaN   \n",
       "\n",
       "    Refurbishment Variant  ...  March Heating demand April Heating demand  \\\n",
       "0                Original  ...                 15987                 4566   \n",
       "1                Original  ...                  3973                 1011   \n",
       "2                Original  ...                  2998                  868   \n",
       "3                Original  ...                 11847                 2785   \n",
       "4                Original  ...                  3669                 1102   \n",
       "..                    ...  ...                   ...                  ...   \n",
       "100              Original  ...                  8581                 2153   \n",
       "101              Original  ...                 15099                 2708   \n",
       "102              Original  ...                  8622                 2174   \n",
       "103              Original  ...                  6895                 1762   \n",
       "104              Original  ...                  7505                 1981   \n",
       "\n",
       "     May Heating demand June Heating demand  July Heating demand  \\\n",
       "0                   673                   2                    0   \n",
       "1                   117                   0                    0   \n",
       "2                   125                   0                    0   \n",
       "3                   333                   1                    0   \n",
       "4                   154                   0                    0   \n",
       "..                  ...                 ...                  ...   \n",
       "100                 289                   1                    0   \n",
       "101                 207                   1                    0   \n",
       "102                 298                   1                    0   \n",
       "103                 226                   1                    0   \n",
       "104                 254                   0                    0   \n",
       "\n",
       "    August Heating demand  September Heating demand  October Heating demand  \\\n",
       "0                       0                       690                    8449   \n",
       "1                       0                       120                    2085   \n",
       "2                       0                       120                    1578   \n",
       "3                       0                       401                    6428   \n",
       "4                       0                       140                    1938   \n",
       "..                    ...                       ...                     ...   \n",
       "100                     0                       286                    4447   \n",
       "101                     0                       295                    7775   \n",
       "102                     0                       292                    4476   \n",
       "103                     0                       284                    3871   \n",
       "104                     0                       307                    4159   \n",
       "\n",
       "     November Heating demand  December Heating demand  \n",
       "0                      19075                    26508  \n",
       "1                       4933                     6905  \n",
       "2                       3597                     5006  \n",
       "3                      15161                    21212  \n",
       "4                       4310                     5964  \n",
       "..                       ...                      ...  \n",
       "100                    10780                    15176  \n",
       "101                    20013                    28298  \n",
       "102                    10820                    15219  \n",
       "103                     8580                    11813  \n",
       "104                     9307                    12859  \n",
       "\n",
       "[105 rows x 54 columns]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "adbf8c7c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "8001948"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['Yearly Heating demand'].sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9c62ba61",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "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.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}