Closed cx1111 closed 4 years ago
Version 0.6.2 (on pip now, and conda shortly) allows you to rename the isnull
and overall
columns.
In the new version, the labels
argument has been changed to rename
. You can include isnull
in the dictionary of variables to rename.
e.g.:
# load sample data into a pandas dataframe
url="https://raw.githubusercontent.com/tompollard/tableone/master/data/pn2012_demo.csv"
data=pd.read_csv(url)
# 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={'isnull': 'missing'}
# set decimal places for age to 0
decimals = {"Age": 0}
# create tableone with the input arguments
mytable = TableOne(data, columns=columns, categorical=categorical,
nonnormal=nonnormal, rename=labels, label_suffix=True, decimals=decimals)
mytable
Hi authors, thanks for the nice package.
It would be nice if there were a way to display the calculated 'isnull' column under another label.