Skip to content

Commit fecca6f

Browse files
committed
Added Tuesday Check
Cleaned up code using & operator, added Tuesday check for day of week
1 parent 0852419 commit fecca6f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

hhs_hosp/delphi_hhs/run.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,9 @@ def run_module(params):
119119
df = smooth_values(df, smoother[0])
120120
# Fix N/A MA values, see issue #1360
121121
if geo == "state" and sensor.startswith(CONFIRMED_FLU):
122-
print(df.shape, geo, smoother, sensor)
123-
df = df[~np.logical_and(np.logical_and(df.val.isna(), df.geo_id == "ma"),
124-
df.timestamp > "08-01-2021")]
125-
print(df.shape)
122+
ma_filter = df.val.isna() & (df.geo_id == "ma") & (df.timestamp > "08-01-2021") & \
123+
(df.timestamp.dt.day_name() == "Tuesday")
124+
df = df[~ma_filter]
126125
if df.empty:
127126
continue
128127
sensor_name = sensor + smoother[1]

0 commit comments

Comments
 (0)