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

WIP: Custom HTML Rendering for Nested Columns #103

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

dougbrn
Copy link
Collaborator

@dougbrn dougbrn commented Jun 5, 2024

Change Description

Resolves #41 .

  • My PR includes a link to the issue that I am addressing

Solution Description

This is a WIP attempt at #41. We're able to modify the representation via the Pandas Styler object, however in my current implementation the styler has some tradeoffs with using the default dataframe representation. Particularly the behavior around how tables are truncated is different (large tables are not truncated down to the first and last 5 entries, instead always truncating to the first max_rows rows. In addition, the truncated df does not preview the shape of the dataframe which feels like a big loss. Overall I'm not happy with where this is currently, but I will keep looking to see if the styler can be brought closer in line with the default pandas behavior. It's possible there are other implementations that might be more appropriate than this approach (can we modify the series styling itself?)

Copy link

github-actions bot commented Jun 5, 2024

Before [6152580] After [7de2f7e] Ratio Benchmark (Parameter)
34.9±3ms 36.2±3ms 1.04 benchmarks.AssignSingleDfToNestedSeries.time_run
1.08±0.01ms 1.13±0.05ms 1.04 benchmarks.NestedFrameReduce.time_run
6.43±0.1ms 6.57±0.5ms 1.02 benchmarks.NestedFrameQuery.time_run
84M 84M 1 benchmarks.NestedFrameAddNested.peakmem_run
88.1M 88.1M 1 benchmarks.NestedFrameQuery.peakmem_run
87.3M 87.2M 1 benchmarks.NestedFrameReduce.peakmem_run
70.7±8ms 71.0±2ms 1 benchmarks.ReassignHalfOfNestedSeries.time_run
276M 272M 0.99 benchmarks.ReassignHalfOfNestedSeries.peakmem_run
259M 255M 0.98 benchmarks.AssignSingleDfToNestedSeries.peakmem_run
10.1±0.9ms 9.91±0.6ms 0.98 benchmarks.NestedFrameAddNested.time_run

Click here to view all benchmarks.

Copy link

codecov bot commented Jun 5, 2024

Codecov Report

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

Project coverage is 98.11%. Comparing base (0bb042a) to head (098a0f2).
Report is 2 commits behind head on main.

Files Patch % Lines
src/nested_pandas/nestedframe/core.py 14.28% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #103      +/-   ##
==========================================
- Coverage   98.77%   98.11%   -0.66%     
==========================================
  Files          15       15              
  Lines         895      902       +7     
==========================================
+ Hits          884      885       +1     
- Misses         11       17       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dougbrn
Copy link
Collaborator Author

dougbrn commented Jul 11, 2024

I've revisted this briefly, this is what this PR can implement. I'm not happy with the loss of information as described above, and am beginning to believe the pandas styler object just does not give us the tools to do something about this.
Screen Shot 2024-07-11 at 4 38 33 PM

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

Successfully merging this pull request may close these issues.

Add a custom html dataframe rendering view of nested columns
1 participant