This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import glob, subprocess | |
| #set path to main directory | |
| #!pwd :: _dir = !pwd | |
| _dir = glob.os.getcwd() | |
| # list all files in the data directory | |
| alld = glob.os.listdir(_dir) | |
| # get remote from those directories that are git repositories |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xtf_id | Address | PostCode | Municipality | Canton | BeginningOfOperation | InitialPower | TotalPower | MainCategory | SubCategory | PlantCategory | _x | _y | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 14727 | Schlosstrasse 15 | 4147 | Aesch BL | BL | 05.05.09 | 14.65 | 18.81 | maincat_2 | subcat_2 | plantcat_9 | 2611935.574 | 1257010.652 | |
| 14728 | Ob der Steig 1 | 5082 | Kaisten | AG | 28.10.11 | 5.80 | 5.80 | maincat_2 | subcat_2 | plantcat_8 | 2645758.387 | 1265094.285 | |
| 10164 | Gässli 4 | 3114 | Wichtrach | BE | 07.10.08 | 3.00 | 3.00 | maincat_2 | subcat_2 | plantcat_8 | 2610546.709 | 1188978.725 | |
| 10794 | Diemtigtalstrasse 46 | 3753 | Oey | BE | 27.06.08 | 8.40 | 8.40 | maincat_2 | subcat_2 | plantcat_8 | 2610528.945 | 1167345.635 | |
| 9476 | Holzweidstrasse 8 | 8340 | Hinwil | ZH | 21.04.06 | 4.80 | 4.80 | maincat_2 | subcat_2 | plantcat_8 | 2705863.006 | 1240552.876 | |
| ? | xxxx_strasse X | 7556;7559 | Valsot | GR | dd.mm.yy | X.X0 | X.X0 | maincat_? | subcat_? | plantcat_? | 2831972.730 | 1201616.228 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import pandas as pd | |
| from datetime import datetime | |
| url='https://www.swissgrid.ch/dam/dataimport/energy-statistic/EnergieUebersichtCH-{YEAR}.xls' | |
| dfs = [] | |
| for y in range(2009,datetime.now().year+1): | |
| # generate url with year in it | |
| url_y = url.format(YEAR=str(y)) |