Wild-Time
Wild-Time copied to clipboard
MIMIC-IV Preprocessing Issues
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
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 :)
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. 🥲
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!