Skip to content

Commit

Permalink
joint_tour_frequency_composition column to categorical (#866)
Browse files Browse the repository at this point in the history
* joint tour freq composition column

* convert jtfc alt to int, auto downcast to efficient int type
  • Loading branch information
i-am-sijia authored May 21, 2024
1 parent f31bfe5 commit d8c5829
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions activitysim/abm/models/joint_tour_frequency_composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ def joint_tour_frequency_composition(

# we expect there to be an alt with no tours - which we can use to backfill non-travelers
no_tours_alt = 0
households_merged["joint_tour_frequency_composition"] = (
choices.reindex(households_merged.index).fillna(no_tours_alt).astype(str)
# keep memory usage down by downcasting
households_merged["joint_tour_frequency_composition"] = pd.to_numeric(
choices.reindex(households_merged.index).fillna(no_tours_alt),
downcast="integer",
)

households_merged["num_hh_joint_tours"] = (
Expand Down

0 comments on commit d8c5829

Please sign in to comment.