# run Prognose
import os, subprocess as sp
def prognose(dir, ver):
cwd = os.getcwd() # merke 'current working directory'
os.chdir('C:/trunk/sikurs'); # wechsle ins SIKURS Installationsverzeichnis
# Starte Prognose für gewählte dir/ver und gebe Kurzpotokoll aus
with sp.Popen(['App/sikern64.exe', 'sikern', '-d', dir, '-v', ver], encoding='utf8', stdout=sp.PIPE) as proc:
print(proc.stdout.read())
os.chdir(cwd) # wechsle zurück
dir = 'C:/trunk/sikurs/beispiel/regtest/'
ver = 'T0'
prognose(dir, ver)
Sonntag, 30. Juli 2023 10:47:07 Prognose C:/trunk/sikurs/beispiel/regtest/T0 Bausteine A0B0C0D0E0G0I0K0M0N0P0R0S0T0V0W0Y0 Summe der Bevölkerung am Stichtag 31.12.1991 24:00 ist 102.610,64 Summe der Bevölkerung am Stichtag 31.12.1992 24:00 ist 102.802,10 Summe der Bevölkerung am Stichtag 31.12.1993 24:00 ist 102.976,14 Ende: 6 Hinweise, 0 Warnungen, 0 Fehler, 1,238 s Laufzeit
import pandas as pd
import matplotlib.pyplot as plt
agg = pd.read_csv(dir + ver + "/agg.csv", sep=';', decimal=",", comment='#', names=["jhr", "gkz", "bg", "gg", "ag", "v"])
#print(agg.info())
zr = agg.groupby(['jhr'])['v'].agg('sum')
print(zr)
plt.title("Prognose")
plt.ylabel("Bevölkerung")
plt.xlabel("Jahr")
plt.xticks([1991, 1992, 1993])
plt.plot(zr, '-ro', label='Tübingen');
plt.legend()
jhr 1991 102610.640880 1992 102802.103861 1993 102976.135019 Name: v, dtype: float64
<matplotlib.legend.Legend at 0x15cd9e06290>