Wild-Time icon indicating copy to clipboard operation
Wild-Time copied to clipboard

MIMIC-IV Preprocessing Issues

Open Nyquixt opened this issue 1 year ago • 3 comments

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

Nyquixt avatar May 09 '23 03:05 Nyquixt

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 :)

ZinebAg avatar May 28 '23 13:05 ZinebAg

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. 🥲

Nyquixt avatar Jun 01 '23 22:06 Nyquixt

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!

aangelopoulos avatar May 05 '24 07:05 aangelopoulos