posit-dev / great-tables

Make awesome display tables using Python.
https://posit-dev.github.io/great-tables/
MIT License
1.9k stars 71 forks source link

Feat: DataFrame functions subset_frame and to_column_dict #415

Closed machow closed 2 months ago

machow commented 3 months ago

This PR adds two new DataFrame generic functions:

These functions were used in prototyping rendering GT as an interactive table in https://github.com/machow/reactable-py/blob/main/reactable/render_gt.py, but I suspect they'll be useful here.

(Alternatively, we could implement them in reactable-py, which also has a _tbl_data.py file?!)

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 76.92308% with 6 lines in your changes missing coverage. Please review.

Project coverage is 86.41%. Comparing base (f403d46) to head (25072af). Report is 4 commits behind head on main.

Files Patch % Lines
great_tables/_tbl_data.py 81.81% 4 Missing :warning:
great_tables/_gt_data.py 50.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #415 +/- ## ========================================== + Coverage 86.40% 86.41% +0.01% ========================================== Files 42 42 Lines 4700 4720 +20 ========================================== + Hits 4061 4079 +18 - Misses 639 641 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

machow commented 2 months ago

Going to close, since I moved the logic into reactable-py