Skip to content

Commit

Permalink
remove filtered alts from alts_long as well
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensle committed Feb 2, 2024
1 parent 25e4f6c commit 43351c6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions activitysim/abm/models/vehicle_type_choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ def construct_model_alternatives(
else:
# eliminate alternatives if no vehicle type data
alts_wide = alts_wide[alts_wide._merge != "left_only"]
# need to also remove any alts from alts_long
alts_long.set_index(["body_type", "fuel_type", "age"], inplace=True)
alts_long = alts_long[
alts_long.index.isin(
alts_wide.set_index(["body_type", "fuel_type", "age"]).index
)
].reset_index()
alts_wide.drop(columns="_merge", inplace=True)

# converting age to integer to allow interactions in utilities
Expand Down

0 comments on commit 43351c6

Please sign in to comment.