def deaths(self) -> pd.DataFrame: brazil_deaths = self.raw_deaths() ref_data = self._reference_data.query('ISO == "BRA"') brazil_deaths = transformations.rescale(brazil_deaths, ref_data, 'deaths_new') brazil_deaths['ISO'] = ISO return brazil_deaths
def cases(self) -> pd.DataFrame: raw_cases = self.raw_cases() cases = transformations.add_both_sexes(raw_cases) cases = transformations.rescale( cases, self._reference_data.query(f'ISO == "{ISO}"'), 'cases_new') cases['ISO'] = ISO return cases
def deaths(self) -> pd.DataFrame: raw_deaths = self.raw_deaths() deaths = transformations.add_both_sexes(raw_deaths) deaths = transformations.rescale( deaths, self._reference_data.query(f'ISO == "{ISO}"'), 'deaths_new') deaths['ISO'] = ISO return deaths
def deaths(self) -> pd.DataFrame: deaths = self.raw_deaths() deaths = transformations.ensure_contiguous(deaths) deaths = transformations.add_both_sexes(deaths) deaths = transformations.smooth_sample(deaths, rolling_window=5) deaths = transformations.rescale( deaths, self._reference_data.query('ISO == "CAN"'), 'deaths_new') deaths['ISO'] = ISO return deaths
def cases(self) -> pd.DataFrame: cases = self.raw_cases() cases = transformations.ensure_contiguous(cases) cases = transformations.add_both_sexes(cases) cases = transformations.smooth_sample(cases, rolling_window=5) cases = transformations.rescale( cases, self._reference_data.query('ISO == "CAN"'), 'cases_new') cases['ISO'] = ISO return cases