44 lines
840 B
Python
44 lines
840 B
Python
|
# -*- coding: utf-8 -*-
|
||
|
"""
|
||
|
Project: Analyse worldwide COVID-19 Data and provide graphs etc.
|
||
|
|
||
|
@author Patrick Müller
|
||
|
"""
|
||
|
import numpy as np
|
||
|
import pandas as pd
|
||
|
import matplotlib.pyplot as plt
|
||
|
import tkinter as tk
|
||
|
|
||
|
"""
|
||
|
Fields in csv:
|
||
|
dateRep
|
||
|
day
|
||
|
month
|
||
|
year
|
||
|
cases
|
||
|
deaths
|
||
|
countriesAndTerritories
|
||
|
geoId
|
||
|
countryterritoryCode
|
||
|
popData2018
|
||
|
"""
|
||
|
|
||
|
|
||
|
class Analyser:
|
||
|
# Pandas Settings
|
||
|
pd.set_option('display.max_row', 1000)
|
||
|
pd.set_option('display.max_column', 10)
|
||
|
|
||
|
df = pd.read_csv('2020-03-28_11-00.csv', encoding='windows-1252')
|
||
|
df['dateRep'] = pd.to_datetime(df['dateRep'])
|
||
|
|
||
|
def getAvailableCountries(self):
|
||
|
return self.df['countriesAndTerritories'].unique()
|
||
|
|
||
|
def germany_cases_graph(self):
|
||
|
fig = plt.figure()
|
||
|
ax = fig.add_subplot(111)
|
||
|
|
||
|
germanyData = self.df[self.df['countriesAndTerritories'].isin(['Germany'])]
|
||
|
print(germanyData)
|