Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chaichd opened this issue Jan 3, 2023 · 0 comments
Open

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

chaichd opened this issue Jan 3, 2023 · 0 comments

Comments

@chaichd
Copy link

chaichd commented Jan 3, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant