-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEXCELDATA1
31 lines (22 loc) · 808 Bytes
/
EXCELDATA1
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
import numpy
import matplotlib.pyplot as plt
from scipy.integrate import odeint
import pandas as pd
df = pd.read_excel(r"C:\Users\ander\OneDrive\Skrivbord\Covid\Covidfall0126.xlsx", parse_dates=['Statistikdatum'])
print(df)
#ax = plt.gca()
#df.plot(kind='line', x='Statistikdatum', y='Totalt_antal_fall', ax=ax, color='pink', label = 'Totalt antal fall')
sthlm_data = []
prev_total = 0
for index, row in df.iterrows():
curr_total = prev_total + row['Stockholm']
sthlm_data.append(curr_total)
prev_total = curr_total
df['total_cases'] = sthlm_data
ax = plt.gca()
df.plot(kind='line', x='Statistikdatum', y='total_cases', ax=ax, color='pink', figsize=(10,7), label="Smittade totalt Stockholm")
plt.legend(loc='best')
plt.ylabel("Antal")
plt.xlabel("Dag")
plt.ylim(bottom=-1)
plt.show()