File:Suomen koronavirus epidemia paivittaiset tapaukset ja kuolemat kevat 2020 1.svg

Original file(SVG file, nominally 877 × 453 pixels, file size: 51 KB)

Captions

Captions

Finnihs coronavirusepidemy: cases, recovered, deaths, active

Summary

edit
Description
English: Coronavirus epidemia in Finland during spring 2020. In this plot only from 26th March, first confirmed Covid-19 case in Finland, to third week of May. Red cases, green recovered, black deaths dark red active cases.
Date
Source Own work
Author Merikanto

Data for this image is downloaded from Gcovid-19 dataset from GitHub

https://datahub.io/core/covid-19/r/countries-aggregated.csv


with script that downloads data and calculates active casst with two moving averages

Then data is further processed with spreadsheed and visualized with SciDavis

Python script to download and process Finnish covid-19 data from github

    1. COVID-19 statistics from aggregated data from net site
    2. with Python
    3. Input from internet site: cases, recovered, deats.
    4. Calculates active cases.
    5. 12.01.2021
    6. 0000.0001

import math as math import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.ticker as ticker import locale from datetime import datetime, timedelta import matplotlib.dates as mdates


from matplotlib.ticker import (MultipleLocator, FormatStrFormatter,

                              AutoMinorLocator)


def format_func(value, tick_number):

   N = int(np.round(value/10))
   if N == 0:
       return "0"
   else:
       return r"${0}\pv$".format(N)
       
       
                          1. main proge


dfin = pd.read_csv('https://datahub.io/core/covid-19/r/countries-aggregated.csv', parse_dates=['Date']) countries = ['Finland'] dfin = dfin[dfin['Country'].isin(countries)]

selected_columns = dfin"Date", "Confirmed", "Recovered", "Deaths"

df2 = selected_columns.copy()

df2.to_csv (r'kovadata1.csv', index = True, header=True, sep=';')

df = pd.read_csv(r'kovadata1.csv', delimiter=';')

len1=len(df["Date"]) aktiv2= [None] * len1 for n in range(0,len1-1): aktiv2[n]=0


dates=df['Date'] rekov1=df['Recovered'] konf1=df['Confirmed'] death1=df['Deaths']

locale.setlocale(locale.LC_TIME, "fi_FI") dates_a = [datetime.strptime(d,'%Y-%m-%d').date() for d in dates]

spanni=6

rulla = rekov1.rolling(window=spanni).mean() rulla2 = rulla.rolling(window=spanni).mean() tulosrulla=rulla2

  1. print (rulla)

x=np.linspace(0,len1,len1);


for n in range(0,(len1-1)): rulla2[n]=round(tulosrulla[n],0) aktiv2[n]=konf1[n]-death1[n]-rulla2[n]

dailycases1= [0] * len1 dailydeaths1= [0] * len1

for n in range(1,(len1-1)): dailycases1[n]=konf1[n]-konf1[n-1] if (dailycases1[n]<0): dailycases1[n]=0

for n in range(1,(len1-1)): dailydeaths1[n]=death1[n]-death1[n-1] if (dailydeaths1[n]<0): dailydeaths1[n]=0


fig, ax1 = plt.subplots(constrained_layout=True)

ax1.tick_params(axis='both', which='major', labelsize=15)

ax1.set_xlabel('Kuukausi', color='g',size=18) ax1.set_ylabel('Päivittäiset uudet tapaukset', color='#7f0000',size=18) ax1.set_title('Koronavirusepidemian 1. aalto Suomessa', color='b',size=22)

ax1.plot(dates_a,dailycases1, linewidth=2.5, color='#7f0000', label="Päivittäiset tapaukset")


ax2 = ax1.twinx() # instantiate a second axes that shares the same x-axis ax2.set_ylabel('Päivittäiset kuolemat', color='black',size=18) ax2.tick_params(axis='both', which='major', labelsize=15) ax2.plot(dates_a,dailydeaths1, linewidth=2, color='black',label="Päivittäiset kuolemat")

lines1, labels1 = ax1.get_legend_handles_labels() lines2, labels2 = ax2.get_legend_handles_labels()

ax2.legend(lines1 + lines2, labels1 + labels2, loc=0, fontsize=16)


plt.show()

plt.savefig('kuva.svg')

for n in range(0,(len1-1)): luku0=aktiv2[n] luku1=luku0.astype(float) if(math.isnan(luku0)): aktiv2[n]=0

aktiv2[len1-1]=0

aktiv3a = np.array(aktiv2)

  1. print(aktiv2)


  1. print(aktiv3a)

aktiv3=aktiv3a.astype(int)

  1. print(aktiv3)


print(df)

  1. df.drop(1, axis=1)

df.insert (2, "Daily_Cases", dailycases1) df.insert (3, "Daily_Deaths", dailydeaths1)

  1. quit()

df['ActiveEst']=aktiv3


dfout = df'Date', 'Confirmed','Deaths','Recovered', 'ActiveEst','Daily_Cases','Daily_Deaths'

print(dfout) dfout.to_csv (r'kovadata2.csv', index = True, header=True, sep=';')



Licensing

edit
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current17:13, 2 September 2020Thumbnail for version as of 17:13, 2 September 2020877 × 453 (51 KB)Merikanto (talk | contribs)Upload
17:11, 2 September 2020Thumbnail for version as of 17:11, 2 September 2020576 × 432 (635 bytes)Merikanto (talk | contribs)Update
15:56, 14 August 2020Thumbnail for version as of 15:56, 14 August 20201,035 × 443 (48 KB)Merikanto (talk | contribs)Update
10:33, 4 August 2020Thumbnail for version as of 10:33, 4 August 20201,037 × 437 (48 KB)Merikanto (talk | contribs)Correction of layout of image
05:38, 4 August 2020Thumbnail for version as of 05:38, 4 August 2020969 × 477 (45 KB)Merikanto (talk | contribs)change contents of image
09:16, 24 May 2020Thumbnail for version as of 09:16, 24 May 20201,109 × 612 (40 KB)Merikanto (talk | contribs)Uploaded own work with UploadWizard

The following page uses this file:

Metadata