Skip to content

Commit

Permalink
fix(vax,ita): metric dbi depcreated in favour of db2 italia/covid…
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasrodes committed Sep 19, 2022
1 parent 0ef4343 commit e1c1260
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions scripts/src/cowidev/vax/batch/italy.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Italy(CountryVaxBase):
"d2",
"dpi",
"db1",
"dbi",
# "dbi",
"db2",
]
columns_rename: dict = {
Expand Down Expand Up @@ -59,13 +59,10 @@ def translate_vaccine_columns(self, df: pd.DataFrame) -> pd.DataFrame:

def get_total_vaccinations(self, df: pd.DataFrame) -> pd.DataFrame:
return df.assign(
total_vaccinations=df.d1
+ df.d2
+ df.dpi
+ df.db1
+ df.dbi
total_vaccinations=df.d1 + df.d2 + df.dpi + df.db1
# + df.dbi
+ df.db2,
total_boosters=df.db1 + df.dbi + df.db2,
total_boosters=df.db1 + df.db2, # + df.dbi ,
)

def pipeline_base(self, df: pd.DataFrame) -> pd.DataFrame:
Expand All @@ -82,9 +79,7 @@ def get_people_vaccinated(self, df: pd.DataFrame) -> pd.DataFrame:
def get_people_fully_vaccinated(self, df: pd.DataFrame) -> pd.DataFrame:
return df.assign(
people_fully_vaccinated=lambda x: x.apply(
lambda row: row["d1"] + row["dpi"]
if row["vaccine"] in self.one_dose_vaccines
else row["d2"],
lambda row: row["d1"] + row["dpi"] if row["vaccine"] in self.one_dose_vaccines else row["d2"],
axis=1,
)
)
Expand Down

0 comments on commit e1c1260

Please sign in to comment.