File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
mimic-iv/buildmimic/sqlite Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 5050def process_dataframe (df : pd .DataFrame , subjects : t .Optional [t .List [int ]] = None ) -> pd .DataFrame :
5151 for c in df .columns :
5252 if c .endswith ('time' ) or c .endswith ('date' ):
53- df [c ] = pd .to_datetime (df [c ], format = 'ISO8601' )
53+ df [c ] = pd .to_datetime (df [c ])
5454
5555 if subjects is not None and 'subject_id' in df :
5656 df = df .loc [df ['subject_id' ].isin (subjects )]
@@ -96,6 +96,15 @@ def main():
9696 print (f"Missing tables: { missing_tables } " )
9797 sys .exit ()
9898
99+ # subselect to only tables in the above list
100+ ignored_files = set ([f for f , t in zip (data_files , tablenames ) if t not in _MIMIC_TABLES ])
101+ data_files = [f for f , t in zip (data_files , tablenames ) if t in _MIMIC_TABLES ]
102+ tablenames = [t for t in tablenames if t in _MIMIC_TABLES ]
103+ print (f"Importing { len (tablenames )} files." )
104+
105+ if ignored_files :
106+ print (f"Ignoring { len (ignored_files )} files: { ignored_files } " )
107+
99108 pt = None
100109 subjects = None
101110 if args .limit > 0 :
You can’t perform that action at this time.
0 commit comments