Skip to content

Instantly share code, notes, and snippets.

@casarock
Created May 19, 2020 08:09
Show Gist options
  • Save casarock/bd3cccae253b52184954aab66ff11c84 to your computer and use it in GitHub Desktop.
Save casarock/bd3cccae253b52184954aab66ff11c84 to your computer and use it in GitHub Desktop.
Calculating interesting stuff
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)
return {
'germany': [
self.germany.tail(1)['sum'][0],
germany
],
'overall': [
self.overall.tail(1)['sum'][0],
overall
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment