Beispiel #1
0
 def pipe_correct_time_series(self, df: pd.DataFrame) -> pd.DataFrame:
     """
     Since 2021-04-14 Luxembourg is using J&J, therefore dose2 == people_fully_vaccinated no longer
     works. As a temporary fix while they report the necessary data, we're inserting one PDF report
     to avoid showing an old value for people_fully_vaccinated in dashboard that re-use our latest
     totals without showing how old they are.
     The publisher was contacted on 2021-O9-21 https://twitter.com/redouad/status/1439992459166158857
     """
     df.loc[df.date >= "2021-04-14", "people_fully_vaccinated"] = pd.NA
     df = add_latest_who_values(df, "Luxembourg",
                                ["people_fully_vaccinated"])
     return df
Beispiel #2
0
 def pipeline(self, ds: pd.Series) -> pd.Series:
     ds = ds.pipe(self.enrich_location).pipe(self.enrich_vaccine).pipe(
         self.enrich_source)
     df = add_latest_who_values(
         ds, "Qatar", ["people_vaccinated", "people_fully_vaccinated"])
     return df
Beispiel #3
0
 def pipeline(self, ds: pd.Series) -> pd.Series:
     """Pipeline for data"""
     df = ds.pipe(self.pipe_location).pipe(self.pipe_vaccine).pipe(
         self.pipe_source)
     df = add_latest_who_values(df, "Philippines", ["people_vaccinated"])
     return df
Beispiel #4
0
 def export(self):
     data = self.read().pipe(self.pipeline)
     df = pd.DataFrame(data).T
     df = add_latest_who_values(df, 'Zambia', ['people_vaccinated'])
     self.export_datafile(df=df, attach=True)
Beispiel #5
0
 def pipeline(self, ds: pd.Series) -> pd.Series:
     ds = ds.pipe(self.format_date).pipe(self.enrich_location).pipe(
         self.enrich_vaccine).pipe(self.enrich_source)
     df = add_latest_who_values(ds, "Republic of Moldova",
                                ["people_vaccinated"])
     return df