Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions activitysim/core/workflow/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,22 +550,22 @@ def interaction_trace_rows(self, interaction_df, choosers, sample_size=None):
# slicer column being in itneraction_df
# or index of interaction_df being same as choosers
if slicer_column_name in interaction_df.columns:
trace_rows = np.in1d(interaction_df[slicer_column_name], targets)
trace_rows = np.isin(interaction_df[slicer_column_name], targets)
trace_ids = interaction_df.loc[trace_rows, slicer_column_name].values
else:
assert interaction_df.index.name == choosers.index.name
trace_rows = np.in1d(interaction_df.index, targets)
trace_rows = np.isin(interaction_df.index, targets)
trace_ids = interaction_df[trace_rows].index.values

else:
if slicer_column_name == choosers.index.name:
trace_rows = np.in1d(choosers.index, targets)
trace_rows = np.isin(choosers.index, targets)
trace_ids = np.asanyarray(choosers[trace_rows].index)
elif slicer_column_name == "person_id":
trace_rows = np.in1d(choosers["person_id"], targets)
trace_rows = np.isin(choosers["person_id"], targets)
trace_ids = np.asanyarray(choosers[trace_rows].person_id)
elif slicer_column_name == "household_id":
trace_rows = np.in1d(choosers["household_id"], targets)
trace_rows = np.isin(choosers["household_id"], targets)
trace_ids = np.asanyarray(choosers[trace_rows].household_id)
else:
assert False
Expand Down
Loading