Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion changehc/delphi_changehc/backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ def store_backfill_file(df, _end_date, backfill_dir, numtype, geo, weekday):
from_col="fips", new_col="state_id")
backfilldata.rename({"timestamp": "time_value"}, axis=1, inplace=True)
#Store one year's backfill data
_start_date = _end_date.replace(year=_end_date.year-1)
if _end_date.day == 29 and _end_date.month == 2:
_start_date = datetime(_end_date.year-1, 2, 28)
else:
_start_date = _end_date.replace(year=_end_date.year-1)
selected_columns = ['time_value', 'fips', 'state_id',
'num', 'den']
backfilldata = backfilldata.loc[backfilldata["time_value"] >= _start_date,
Expand Down