Skip to content

Don't drop positivity signal when interpolating #1590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2022
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
8 changes: 7 additions & 1 deletion dsew_community_profile/delphi_dsew_community_profile/pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ def interpolate_missing_values(dfs: DataDict) -> DataDict:
# https://github.com/cmu-delphi/covidcast-indicators/issues/1576
_, sig, _ = key
if sig == "positivity":
interpolate_df[key] = df.set_index(["geo_id", "timestamp"]).sort_index().reset_index()
continue

geo_dfs = []
Expand Down Expand Up @@ -652,7 +653,12 @@ def interpolate_missing_values(dfs: DataDict) -> DataDict:
)
geo_dfs.append(reindexed_group_df)
interpolate_df[key] = (
pd.concat(geo_dfs).reset_index().rename(columns={"index": "timestamp"})
pd.concat(geo_dfs)
.reset_index()
.rename(columns={"index": "timestamp"})
.set_index(["geo_id", "timestamp"])
.sort_index()
.reset_index()
)
return interpolate_df

Expand Down