import numpy as np
import pandas as pd
from covid19_data_analyzer.data_functions.scrapers import get_data
from covid19_data_analyzer.data_functions.data_utils import get_daily_growth, get_growth_rate
covid19_data = get_data()
berlin = covid19_data[covid19_data.region=="Berlin"]
berlin.plot(x="date", y=["confirmed", "recovered", "deaths"], title="covid19 data")
<AxesSubplot:title={'center':'covid19 data'}, xlabel='date'>
daily_growth = get_daily_growth(covid19_data)
berlin = daily_growth[daily_growth.region=="Berlin"]
berlin.plot(x="date", y=["confirmed", "recovered", "deaths"], title="covid19 daily growth")
berlin
growth_rate = get_growth_rate(covid19_data)
berlin = growth_rate[growth_rate.region=="Berlin"]
berlin.plot(x="date", y=["confirmed"], title="covid19 growth rate")
berlin = growth_rate[growth_rate.region=="Italien"]
berlin.plot(x="date", y=["confirmed"], title="covid19 growth rate", ylim=(0, 2))
covid19_data
growth_rate[(growth_rate.region=="Italien") | (growth_rate.region=="Berlin")]
selector = pd.DataFrame([growth_rate.region=="Italien", growth_rate.region=="Berlin"]).apply(lambda row: any(row))
growth_rate[selector].region.unique()
selector