Example #1
0
 def to_csv(self, paths):
     output_file = paths.tmp_vax_out(self.location)
     last_update = pd.read_csv(output_file).date.max()
     df = self.read(last_update)
     if not df.empty:
         df = df.pipe(self.pipeline)
         df = merge_with_current_data(df, output_file)
         df.to_csv(output_file, index=False)
Example #2
0
 def export(self, paths):
     output_file = paths.tmp_vax_out(self.location)
     last_update = pd.read_csv(output_file).date.astype(str).max()
     df = self.read(last_update)
     if df is not None:
         df = df.pipe(self.pipeline)
         df = merge_with_current_data(df, output_file)
         df.to_csv(output_file, index=False)
Example #3
0
 def to_csv(self, paths):
     """Generalized."""
     output_file = paths.tmp_vax_out(self.location)
     last_update = pd.read_csv(output_file).date.max()
     df = self.read(last_update)
     if not df.empty and "people_vaccinated" in df.columns:
         df = df.pipe(self.pipeline)
         df = merge_with_current_data(df, output_file)
         df = df.pipe(self.pipe_drop_duplicates)
         df.to_csv(output_file, index=False)