Skip to content
New issue

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

Calculate row percentages #108

Closed
gothmania opened this issue Dec 10, 2020 · 3 comments
Closed

Calculate row percentages #108

gothmania opened this issue Dec 10, 2020 · 3 comments

Comments

@gothmania
Copy link

Hi,

Sometimes I want to calculate the row percentages instead of column percentages. For example,

Category Group A Group B
Cat 1 100 (25%) 300 (75%)
Cat 2 400 (67%) 200 (33%)

instead of

Category Group A Group B
Cat 1 100 (20%) 300 (60%)
Cat 2 400 (80%) 200 (40%)

Could you consider adding an argument like row_percent to specify categorical variables whose row percentages should be calculated?

Thanks a lot,
Long

@tompollard
Copy link
Owner

Thanks Long, this is something that I've been meaning to implement for a while. I'll try to take a look soon.

@tompollard
Copy link
Owner

Thanks again for the suggestion @gothmania. There is a new "row_percent" argument in version 0.7.10: https://pypi.org/project/tableone/0.7.10/ (available in Conda soon). Please give it a try and let us know if you come across any issues!

@gothmania
Copy link
Author

Hi Tom,

I just checked the new argument. It works perfect.
Thanks a lot of your quick response.

Long

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants