Skip to content

Commit

Permalink
fixing datatype issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensle committed Apr 12, 2024
1 parent 464ee59 commit a024eff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions activitysim/abm/models/util/school_escort_tours_trips.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def create_chauf_trip_table(bundles):
)

bundles.drop(columns=["dropoff"], inplace=True)
bundles["person_id"] = bundles["person_id"].fillna(-1).astype(int)
bundles["person_id"] = bundles["person_id"].fillna(-1).astype("int64")

bundles.index = original_index
return bundles
Expand Down Expand Up @@ -506,7 +506,7 @@ def create_child_escorting_stops(bundles, escortee_num):
)

bundles.drop(columns=["dropoff", "pickup_count"], inplace=True)
bundles["person_id"] = bundles["person_id"].fillna(-1).astype(int)
bundles["person_id"] = bundles["person_id"].fillna(-1).astype("int64")

bundles.index = original_index
return bundles
Expand Down Expand Up @@ -646,9 +646,11 @@ def process_tours_after_escorting_model(state: workflow.State, escort_bundles, t
tours = add_school_escorting_type_to_tours_table(escort_bundles, tours)

# setting number of escortees on tour
num_escortees = escort_bundles.drop_duplicates("chauf_tour_id").set_index(
"chauf_tour_id"
)["num_escortees"]
num_escortees = (
escort_bundles.drop_duplicates("chauf_tour_id")
.set_index("chauf_tour_id")["num_escortees"]
.astype(int)
)
tours.loc[num_escortees.index, "num_escortees"] = num_escortees

# set same start / end time for tours if they are bundled together
Expand Down
Binary file not shown.

0 comments on commit a024eff

Please sign in to comment.