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

KeyError: 'subject_id" when calling pd.DataFrame.pivot_table in mortality / LOS baseline #48

Open
jamin-chen opened this issue Feb 15, 2021 · 2 comments

Comments

@jamin-chen
Copy link

Hello, I'm currently running through the notebook for predicting mortality / LOS, and got the following error when running the cell that calls pd.DataFrame.pivot_table:

image

For reference, this is what one of the dataframes looks like:

image

Could I get some help with this? What is the intended operation / output of this cell? Thanks 😄

@jamin-chen jamin-chen changed the title KeyError: 'subject_id" when calling pd.DataFrame.pivot_table in mortality / LOS baseline KeyError: 'subject_id" when calling pd.DataFrame.pivot_table in mortality / LOS baseline Feb 15, 2021
@jamin-chen
Copy link
Author

I was able to run the code and train the models with the following change:

df.reset_index().pivot_table(...

though it does fail the null assertion at the end of the cell:

for df in lvl2_train, lvl2_dev, lvl2_test, raw_train, raw_dev, raw_test: assert not df.isnull().any().any()

Is this fix the right way to go?

@shan23chen
Copy link

Hi, may I ask where did you find the h5 files for the third cell:
DATA_FILEPATH = '/scratch/mmd/mimic_data/final/grouping_5/all_hourly_data.h5' RAW_DATA_FILEPATH = '/scratch/mmd/mimic_data/final/nogrouping_5/all_hourly_data.h5'

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

2 participants