YerevaNN / mimic3-benchmarks

Python suite to construct benchmark machine learning datasets from the MIMIC-III 💊 clinical database.
https://arxiv.org/abs/1703.07771
MIT License
806 stars 329 forks source link

ValueError: Use `.rename` to alter labels with a mapper. #138

Open chaichd opened 1 year ago

chaichd commented 1 year ago

This error occurs when I run the extract_episodes_from_subjects file,The error code is the last line below:

def read_itemid_to_variable_map(fn, variable_column='LEVEL2'): var_map = dataframe_from_csv(fn, index_col=None).fillna('').astype(str) var_map.COUNT = var_map.COUNT.astype(int) var_map = var_map.loc[(var_map[variable_column] != '') & (var_map.COUNT > 0)] var_map = var_map.loc[(var_map.STATUS == 'ready')] var_map.ITEMID = var_map.ITEMID.astype(int) var_map = var_map[[variable_column, 'ITEMID', 'MIMIC LABEL']].set_index('ITEMID') return var_map.rename_axis({variable_column: 'VARIABLE', 'MIMIC LABEL': 'MIMIC_LABEL'}, axis=1)