We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be good to support multilevel groupby arguments. e.g. groupby = ['icu_type','gender'].
groupby = ['icu_type','gender']
e.g.: achieve something similar to:
from tableone import TableOne import pandas as pd url="https://raw.githubusercontent.com/tompollard/tableone/master/data/pn2012_demo.csv" data=pd.read_csv(url) df = TableOne(data) pd.concat([df.tableone,df.tableone], axis=1)
Notes:
# columns to be summarized columns = ['Age', 'SysABP', 'Height', 'Weight', 'ICU', 'death'] # columns containing categorical variables categorical = ['ICU', 'death'] # non-normal variables nonnormal = ['Age'] # alternative labels labels={'LOS': 'Length of stay', 'death': 'mortality'} groupby = ['death'] second = 'ICU' tdict = {} for d in data[second].unique(): print(d) tdict[d] = TableOne(data[data[second] == d], columns, categorical, groupby, nonnormal) pd.concat([tdict['SICU'].tableone,tdict['CSRU'].tableone,tdict['MICU'].tableone],axis=1) pd.concat([tdict[x].tableone for x in data[second].unique()],axis=1)
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
It would be good to support multilevel groupby arguments. e.g.
groupby = ['icu_type','gender']
.e.g.: achieve something similar to:
Notes:
The text was updated successfully, but these errors were encountered: