This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
import yaml | |
import coronaStats as st | |
def load_config(): | |
with open("config.yaml", 'r') as stream: | |
try: | |
config = yaml.safe_load(stream) | |
return config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def plot_diagram(self, | |
yvalue, | |
xlabel, | |
ylabel, | |
title, | |
filename): | |
plt.figure(figsize=(8,5)) | |
ax = plt.gca() | |
self.overall.plot(kind='line', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_weekly_growth(self): | |
frame = self.germany.tail(7) | |
actual = frame['sum'][-1] | |
days_before = frame['sum'][0] | |
growth_rate = (actual*100/days_before) - 100 | |
return growth_rate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_actual_infected(self): | |
germany_changed = self.germany.tail(2)['sum'][1] - self.germany.tail(2)['sum'][0] | |
overall_changed = self.overall.tail(2)['sum'][1] - self.overall.tail(2)['sum'][0] | |
germany = '+' if germany_changed > 0 else '-' | |
overall = '+' if overall_changed > 0 else '-' | |
germany += str(germany_changed) | |
overall += str(overall_changed) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def clean_Data(self, data_frame, country, drop_columns): | |
cleaned_data_frame = data_frame.drop(columns=drop_columns) | |
cleaned_data_frame = cleaned_data_frame.T | |
cleaned_data_frame['related'] = (100/self.population[country]) * cleaned_data_frame['sum'] | |
return cleaned_data_frame |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_clean_data(self): | |
df = pd.read_csv(self.csv_url) | |
df = df.drop(columns=['Lat', 'Long']) | |
df_group = df.groupby(['Country/Region']) | |
germany = df_group.get_group('Germany') | |
overall = df.agg(['sum']) | |
germany = germany.agg(['sum']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
import XCPlayground | |
class ClockView: UIView { | |
private var shapeLayer = CAShapeLayer() | |
private var countDownTimer = NSTimer() | |
private var timerValue = 900 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="../core-animated-pages/core-animated-pages.html" rel="import"> | |
<link href="../core-animated-pages/transitions/hero-transition.html" rel="import"> | |
<link href="../core-animated-pages/transitions/cross-fade.html" rel="import"> | |
<link href="../core-animated-pages/transitions/slide-down.html" rel="import"> | |
<link href="../core-animated-pages/transitions/slide-up.html" rel="import"> | |
<link href="../core-animated-pages/transitions/tile-cascade.html" rel="import"> | |
<link href="../core-field/core-field.html" rel="import"> | |
<link href="../core-icon/core-icon.html" rel="import"> | |
<link href="../core-input/core-input.html" rel="import"> | |
<link href="../core-icons/core-icons.html" rel="import"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Acc.Game = function (game) { | |
this.game = game; | |
}; | |
Acc.Game.prototype = { | |
create: function () { | |
this.MAX_VELX = 125; |
NewerOlder