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

MIMIC-IV Preprocessing Issues #9

Open
Nyquixt opened this issue May 9, 2023 · 3 comments
Open

MIMIC-IV Preprocessing Issues #9

Nyquixt opened this issue May 9, 2023 · 3 comments

Comments

@Nyquixt
Copy link

Nyquixt commented May 9, 2023

I tried running the code on MIMIC-IV and the preprocessing code gave me the following error:

File "Wild-Time/wildtime/data/mimic.py", line 272, in preprocess_MIMIC
    temp_datasets[eachyear]['code'] = np.array(temp_datasets[eachyear]['code'])
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (76175, 2) + inhomogeneous part.

Could you double check this issue? Thanks in advance!

-K

@ZinebAg
Copy link

ZinebAg commented May 28, 2023

Hi, got the same issue.
I changed "temp_datasets[eachyear]['code'] = np.array(temp_datasets[eachyear]['code'])" to "temp_datasets[eachyear]['code'] =np.asarray(temp_datasets[eachyear]['code'],dtype="object")" and it worked for me.
Hope it helps :)

@Nyquixt
Copy link
Author

Nyquixt commented Jun 1, 2023

Thanks. I actually figured out a simpler solution but forgot to update the issue. Downgrading numpy to v1.19.5 (just like in the requirements.txt file) solved the problem. 🥲

@aangelopoulos
Copy link

The suggestion by @ZinebAg to change the line to temp_datasets[eachyear]['code'] =np.asarray(temp_datasets[eachyear]['code'],dtype="object") worked for me as well.

Someone should open a PR!

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

3 participants