tompollard / tableone

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

Support custom precision for measurements #46

Closed tompollard closed 5 years ago

tompollard commented 6 years ago

Support custom precision for variables (e.g., report age to 0dp). This point is highlighted in http://www.equator-network.org/wp-content/uploads/2013/07/SAMPL-Guidelines-6-27-13.pdf

e.g. format = {age: "{:.0f}"}

tompollard commented 5 years ago

Version 0.5.16 allows number of decimal places to be specified for continuous variables, using the decimals argument. The number can be specified as a single integer (e.g. decimals=2) or a dictionary (e.g. decimals = {'age':2, 'weight':3}. Does not yet address percentages for categorical variables (ref #74).