We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5aacf84 + b666380 commit 8e38af7Copy full SHA for 8e38af7
1 file changed
src/patientflow/prepare.py
@@ -595,8 +595,9 @@ def prepare_patient_snapshots(
595
df_single = select_one_snapshot_per_visit(df_tod, visit_col)
596
# Create label array with the same index
597
y = df_single.pop(label_col).astype(int)
598
- # Drop specified columns and ensure we do not reset the index
599
- df_single.drop(columns=exclude_columns, inplace=True)
+ # Drop specified columns and ensure we do not reset the index.
+ # Ignore missing column names so behavior matches the multi-snapshot path.
600
+ df_single.drop(columns=exclude_columns, inplace=True, errors="ignore")
601
return df_single, y
602
else:
603
# Directly modify df_tod without resetting the index
0 commit comments