covid-19-analysis/Analyser.py

44 lines
840 B
Python
Raw Normal View History

2020-03-28 11:37:54 +00:00
# -*- 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)