How can I create a clinical summary table with polars in python? I am looking for something that is similar to the functionality of Tplyr.
The original dataframe has the following columns (each row represents a patient)
- patient number
- age
- age group (derived variable from age)
- sex
- race
The output should be in this form (from here)
If it helps, I can also create a dummy dataset. Any idea how to provide something that goes into that direction with polars? I understand how to do that for a single line (with group by), but I have no idea how to do it in this summarized form.
Thank you very much!