Skip to content

Commit 43a13bc

Browse files
committed
move apply_final_rules work into numpy funcs
1 parent 2d98991 commit 43a13bc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

activitysim/cdap/cdap.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,10 @@ def apply_final_rules(hh_util, people, hh_id_col, final_rules):
243243
# - the individual alternative to which the rule applies
244244
# (alt)
245245
# - the alternative combinations for the household (combo)
246-
app = [((alt == combo) & m).any() for combo in utils.index]
246+
app = np.any(
247+
np.bitwise_and(
248+
(np.array(utils.index.values.tolist()) == alt), m),
249+
axis=1)
247250

248251
utils[app] = row.iloc[1]
249252

0 commit comments

Comments
 (0)