mimic3-benchmarks
mimic3-benchmarks copied to clipboard
ValueError: time data '2109-03-20' does not match format '%Y-%m-%d %H:%M:%S'
when I execute python -m mimic3benchmark.scripts.create_decompensation data/root/ data/decompensation/ this error occurs; when I print the deathtime and intime, terminal print: deathtime= nan inttime= 2133-03-11 deathtime= 2109-03-20 16:33:00 inttime= 2109-03-20
my solution: because intime doesn't have hours/minutes/seconds So just remove %H:%M:%S in datetime.strptime(intime, "%Y-%m-%d")).total_seconds() / 3600.0 in create_decompensation.py
code: if pd.isnull(deathtime): lived_time = 1e18 else: lived_time = (datetime.strptime(deathtime, "%Y-%m-%d %H:%M:%S") - datetime.strptime(intime, "%Y-%m-%d")).total_seconds() / 3600.0 #%Y-%m-%d %H:%M:%S