Skip to content

Commit

Permalink
Update full_preprocessing.py
Browse files Browse the repository at this point in the history
  • Loading branch information
juanlopezcode authored Aug 9, 2024
1 parent a4dffb3 commit 12ec246
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/full_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def get_diagnosis_ed(subject_id, ecg_time,also_hosp_diag=True):
unique_intervals = age_bins.cat.categories
bin_labels = {interval: f'{interval.left}-{interval.right}' for interval in unique_intervals}
df_full['age_bin'] = age_bins.map(bin_labels)
df_full['age_bin'] = df_full['age_bin'].cat.add_categories(['missing']).fillna('missing')
df_full['gender'] = df_full['gender'].fillna('missing')
df_full['age_bin'] = df_full['age_bin'].cat.add_categories(['missing_age']).fillna('missing_age')
df_full['gender'] = df_full['gender'].fillna('missing_gender')

df_full['merged_strat'] = df_full.apply(lambda row: row['label_strat_all2all'] + [row['age_bin'], row['gender']], axis=1)

Expand Down

0 comments on commit 12ec246

Please sign in to comment.