Skip to content

Making one CSV from multiple tables MIMIC - III #1386

Discussion options

You must be logged in to vote

Hi @Ioanni-Balassis,
If working from the csv files my approach would be to use the Python Pandas library or alternatively you can use R dplyr library. See some sample Python code below that should work, here I am getting the text field from the noteevents table.

import pandas as pd
admissions = pd.read_csv('ADMISSIONS.csv.gz')
noteevents = pd.read_csv('NOTEEVENTS.csv.gz')
df = pd.merge(admissions[['HADM_ID', 'ADMITTIME', 'DISCHTIME']], noteevents[['HADM_ID','TEXT']], on='HADM_ID', how='left')
df.to_csv('my_results.csv', index=False)

If working from BigQuery then you can write a query to join the admissions table with the noteevents table on HADM_ID using the same logic as above, and then…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alistairewj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants