Skip to content

Commit 0a66387

Browse files
committed
Update to new enum nancodes
1 parent 831f554 commit 0a66387

File tree

1 file changed

+5
-5
lines changed
  • safegraph_patterns/delphi_safegraph_patterns

1 file changed

+5
-5
lines changed

safegraph_patterns/delphi_safegraph_patterns/process.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import numpy as np
77
import pandas as pd
88

9-
from delphi_utils import create_export_csv, GeoMapper, NAN_CODES
9+
from delphi_utils import create_export_csv, GeoMapper, Nans
1010

1111
INCIDENCE_BASE = 100000
1212

@@ -127,15 +127,15 @@ def aggregate(df, metric, geo_res):
127127
def add_nancodes(df):
128128
"""Add nan codes to the df."""
129129
# Values are not missing unless found to be null
130-
df["missing_val"] = NAN_CODES["Not Missing"]
130+
df["missing_val"] = Nans.NOT_MISSING
131131

132132
# These values aren't reported, so are always missing
133-
df["missing_se"] = NAN_CODES["Not Applicable"]
134-
df["missing_sample_size"] = NAN_CODES["Not Applicable"]
133+
df["missing_se"] = Nans.NOT_APPLICABLE
134+
df["missing_sample_size"] = Nans.NOT_APPLICABLE
135135

136136
# Mark any remaining nans with unknown
137137
remaining_nans_mask = (df["missing_val"] == 0) & df["val"].isnull()
138-
df.loc[remaining_nans_mask, "missing_val"] = NAN_CODES["Unknown"]
138+
df.loc[remaining_nans_mask, "missing_val"] = Nans.UNKNOWN
139139

140140
return df
141141

0 commit comments

Comments
 (0)