bucky.util.get_historical_data

utilities to read historical data that cooresponds to a bucky output file.

Module Contents

Functions

add_daily_history(history_data, window_size=None)

Return daily historical data from a diff of the historical cumulative data.

get_historical_data(columns, level, lookup_df, window_size, hist_file)

Return historical data for requested columns.

bucky.util.get_historical_data.covid_tracking[source]
bucky.util.get_historical_data.csse[source]
bucky.util.get_historical_data.data_locations[source]
bucky.util.get_historical_data.graph_file[source]
bucky.util.get_historical_data.hhs_hosp[source]
bucky.util.get_historical_data.vacc[source]
bucky.util.get_historical_data.add_daily_history(history_data, window_size=None)[source]

Return daily historical data from a diff of the historical cumulative data.

Parameters
  • history_data (pandas.DataFrame) – Cumulative case and death data

  • window_size (int or None) – Size of window in days

Returns

history_data – Historical data with added columns for daily case and death data

Return type

pandas.DataFrame

bucky.util.get_historical_data.get_historical_data(columns, level, lookup_df, window_size, hist_file)[source]

Return historical data for requested columns.

Parameters
  • columns (list of str) – Column names for historical data

  • level (str) – Geographic level to get historical data for, e.g. adm1

  • lookup_df (pandas.DataFrame) – Dataframe with names and values for admin0, admin1, and admin2 levels

  • window_size (int) – Size of window in days

  • hist_file (str or None) – Historical data file to use if not using defaults.

Returns

history_data – Historical data indexed by data and geographic level containing only requested columns

Return type

pandas.DataFrame