tompollard / tableone

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

Output only top N frequent categories #15

Closed alistairewj closed 6 years ago

alistairewj commented 7 years ago

It would be nice to have a feature where only the top N category levels are output, e.g. if I have 400 diagnoses, only the top 10 in terms of frequency are output to file.

tompollard commented 6 years ago

Might be helpful when implementing this: https://stackoverflow.com/questions/20069009/pandas-good-approach-to-get-top-n-records-within-each-group