From 525fd7cfcbd2ab0f25ed2df4af3a9f43f9274ab5 Mon Sep 17 00:00:00 2001 From: Jeff Newman Date: Thu, 22 Feb 2024 12:57:09 -0600 Subject: [PATCH] no categories for escort participants --- activitysim/abm/models/util/school_escort_tours_trips.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/activitysim/abm/models/util/school_escort_tours_trips.py b/activitysim/abm/models/util/school_escort_tours_trips.py index 42108dfbd..d8b5386eb 100644 --- a/activitysim/abm/models/util/school_escort_tours_trips.py +++ b/activitysim/abm/models/util/school_escort_tours_trips.py @@ -489,9 +489,10 @@ def merge_school_escort_trips_into_pipeline(state: workflow.State): # converting to categoricals trips["school_escort_direction"] = trips["school_escort_direction"].astype( - "category" + pd.api.types.CategoricalDtype(["outbound", "inbound"], ordered=False) ) - trips["escort_participants"] = trips["escort_participants"].astype("category") + # trips["escort_participants"] is left with dtype of object (i.e. Python strings) + # as it doesn't have a fixed number of categories # updating trip_id now that we have all trips trips = canonical_ids.set_trip_index(state, trips)