Skip to content

Commit bab6974

Browse files
authored
Merge pull request #471 from The-Strategy-Unit/force_factor_to_be_float
2 parents e63163a + 4cc8820 commit bab6974

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/nhp/model/activity_resampling.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ def data(self):
8181
def _update(self, factor: pd.Series):
8282
step = factor.name
8383

84-
factor = self.data.merge(factor, how="left", left_on=factor.index.names, right_index=True)[
85-
step
86-
].fillna(1)
84+
factor = (
85+
self.data.merge(factor, how="left", left_on=factor.index.names, right_index=True)[step]
86+
.astype(float)
87+
.fillna(1.0)
88+
)
8789

8890
self.factors.append(factor)
8991

0 commit comments

Comments
 (0)