예제 #1
0
 def pipe_add_vaccines(self, df: pd.DataFrame) -> pd.DataFrame:
     schedule = {
         "Pfizer/BioNTech": "2020-12-01",
         "Moderna": "2020-12-23",
         "Johnson&Johnson": "2021-03-05",
     }
     return build_vaccine_timeline(df, schedule)
예제 #2
0
 def pipe_add_vaccines(self, df: pd.DataFrame) -> pd.DataFrame:
     return build_vaccine_timeline(
         df,
         {
             "Sinovac": "2021-02-22",
             "Pfizer/BioNTech": "2021-03-06",
         },
     )
예제 #3
0
 def pipe_metadata(self, df: pd.DataFrame) -> pd.DataFrame:
     # Metadata
     df = df.assign(location=self.location, source_url=self.source_url)
     # Add vaccines
     return build_vaccine_timeline(
         df,
         self.vax_timeline,
     )
예제 #4
0
 def pipe_vaccine(self, df: pd.DataFrame, vax_timeline):
     dfs = []
     locations = df.location.unique()
     for location in locations:
         df_c = df[df.location == location]
         df_c = build_vaccine_timeline(df_c, vax_timeline[location])
         dfs.append(df_c)
     return pd.concat(dfs, ignore_index=True)
예제 #5
0
 def pipe_vaccine(self, df: pd.DataFrame) -> pd.DataFrame:
     vax_timeline = {
         "Oxford/AstraZeneca": "2021-02-26",
         "Pfizer/BioNTech": "2021-02-27",
         "Moderna": "2021-06-18",
         "Johnson&Johnson": "2021-06-10",
         "Novavax": "2022-02-14",
     }
     return build_vaccine_timeline(df, vax_timeline)
예제 #6
0
 def pipe_vaccine(self, df: pd.DataFrame) -> pd.DataFrame:
     return build_vaccine_timeline(
         df,
         {
             "Pfizer/BioNTech": "2020-01-01",
             "Moderna": "2021-02-09",
             "Oxford/AstraZeneca": "2021-02-09",
             "Johnson&Johnson": "2021-04-26",
         },
     )
예제 #7
0
 def pipe_vaccine(self, df: pd.DataFrame) -> pd.DataFrame:
     df = build_vaccine_timeline(
         df,
         {
             "Sinopharm/Beijing": "2021-01-01",
             "Oxford/AstraZeneca": "2021-03-29",
             "Sinovac": "2021-03-30",
             "Sputnik V": "2021-06-11",
         },
     )
     return df
예제 #8
0
 def pipe_vaccine(self, df: pd.DataFrame) -> pd.DataFrame:
     return build_vaccine_timeline(
         df,
         {
             "Sputnik V": "2021-01-01",
             "Oxford/AstraZeneca": "2021-04-04",
             "Sinopharm/Beijing": "2021-04-04",
             "Pfizer/BioNTech": "2021-05-04",
             "Johnson&Johnson": "2021-08-24",
         },
     )
예제 #9
0
 def pipe_vaccine(self, df: pd.DataFrame) -> pd.DataFrame:
     df = build_vaccine_timeline(
         df,
         {
             "Oxford/AstraZeneca": "2021-01-01",
             "Sinovac": "2021-04-14",
             "Pfizer/BioNTech": "2021-04-18",
             "Johnson&Johnson": "2021-05-22",
             "Moderna": "2021-07-23",
         },
     )
     return df
예제 #10
0
 def pipe_vaccine(self, df: pd.DataFrame):
     return build_vaccine_timeline(
         df,
         {
             "Sputnik V": "2020-12-29",
             "Sinopharm/Beijing": "2021-03-08",
             "Oxford/AstraZeneca": "2021-03-08",
             "Moderna": "2021-08-03",
             "CanSino": "2021-09-09",
             "Pfizer/BioNTech": "2021-09-17",
         },
     )
예제 #11
0
 def pipe_metadata(self, df: pd.DataFrame):
     df = df.assign(
         location=self.location,
         source_url=self.source_url_ref,
         vaccine="Moderna, Oxford/AstraZeneca, Pfizer/BioNTech",
     )
     df = build_vaccine_timeline(
         df,
         {
             "Moderna": "2021-01-02",
             "Oxford/AstraZeneca": "2021-03-13",
             "Pfizer/BioNTech": "2020-12-01",
             "Johnson&Johnson": "2021-07-17",
         },
     )
     return df
예제 #12
0
 def pipe_vaccine(self, df: pd.DataFrame) -> pd.DataFrame:
     df = build_vaccine_timeline(df, self.vax_timeline)
     return df
예제 #13
0
 def enrich_vaccine(self, df: pd.DataFrame) -> pd.DataFrame:
     vax_timeline = self._vaccine_start_dates(df)
     return build_vaccine_timeline(df, vax_timeline)
예제 #14
0
 def pipe_vaccines(self, df: pd.DataFrame) -> pd.DataFrame:
     return build_vaccine_timeline(df, self.vaccine_timeline)
예제 #15
0
 def pipe_vaccine(self, df: pd.DataFrame) -> pd.DataFrame:
     """Builds the vaccine timeline."""
     return build_vaccine_timeline(df, self.vaccines_start_date)