tompollard / tableone

Create "Table 1" for research papers in Python
https://pypi.python.org/pypi/tableone/
MIT License
164 stars 41 forks source link

labels input argument does not rename groupby column #38

Closed alistairewj closed 6 years ago

alistairewj commented 6 years ago

reproducible example:

url="https://raw.githubusercontent.com/tompollard/data/master/primary-biliary-cirrhosis/pbc.csv"
df=pd.read_csv(url)
columns = ['age', 'albumin', 'ast', 'trt']
categorical = ['trt']
groupby = 'sex'

labels = {'sex': 'gender', 'trt': 'treatment'}

table = TableOne(df, columns=columns, categorical=categorical, groupby=groupby, labels=labels)