Skip to content

Commit 1f75739

Browse files
committed
np.in1d -> np.isin
1 parent aa1a3ff commit 1f75739

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

activitysim/core/workflow/tracing.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -550,22 +550,22 @@ def interaction_trace_rows(self, interaction_df, choosers, sample_size=None):
550550
# slicer column being in itneraction_df
551551
# or index of interaction_df being same as choosers
552552
if slicer_column_name in interaction_df.columns:
553-
trace_rows = np.in1d(interaction_df[slicer_column_name], targets)
553+
trace_rows = np.isin(interaction_df[slicer_column_name], targets)
554554
trace_ids = interaction_df.loc[trace_rows, slicer_column_name].values
555555
else:
556556
assert interaction_df.index.name == choosers.index.name
557-
trace_rows = np.in1d(interaction_df.index, targets)
557+
trace_rows = np.isin(interaction_df.index, targets)
558558
trace_ids = interaction_df[trace_rows].index.values
559559

560560
else:
561561
if slicer_column_name == choosers.index.name:
562-
trace_rows = np.in1d(choosers.index, targets)
562+
trace_rows = np.isin(choosers.index, targets)
563563
trace_ids = np.asanyarray(choosers[trace_rows].index)
564564
elif slicer_column_name == "person_id":
565-
trace_rows = np.in1d(choosers["person_id"], targets)
565+
trace_rows = np.isin(choosers["person_id"], targets)
566566
trace_ids = np.asanyarray(choosers[trace_rows].person_id)
567567
elif slicer_column_name == "household_id":
568-
trace_rows = np.in1d(choosers["household_id"], targets)
568+
trace_rows = np.isin(choosers["household_id"], targets)
569569
trace_ids = np.asanyarray(choosers[trace_rows].household_id)
570570
else:
571571
assert False

0 commit comments

Comments
 (0)