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

frame-level get and set interface #135

Merged
merged 3 commits into from
Aug 13, 2024
Merged

frame-level get and set interface #135

merged 3 commits into from
Aug 13, 2024

Conversation

dougbrn
Copy link
Collaborator

@dougbrn dougbrn commented Aug 12, 2024

Change Description

Resolves #99

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

Solution Description

This PR enables a pandas-like get and set interface with nested columns. The implementation is just augmenting __getitem__ and __setitem__ to understand the hierarchical column naming scheme and handle it appropriately. We have held off on this because nested-pandas is not optimized for it, as this implementation involves a full rebuild of a nested column when doing things like adding or modifying a column. I added a tutorial with a note on this performance issue, but it's probably better that this is here but slow instead of sitting in the backlog :)

Code Quality

  • I have read the Contribution Guide
  • My code follows the code style of this project
  • My code builds (or compiles) cleanly without any errors or warnings
  • My code contains relevant comments and necessary documentation

Copy link

codecov bot commented Aug 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.45%. Comparing base (a2272cd) to head (306aa38).
Report is 61 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #135      +/-   ##
==========================================
+ Coverage   99.44%   99.45%   +0.01%     
==========================================
  Files          14       14              
  Lines         897      917      +20     
==========================================
+ Hits          892      912      +20     
  Misses          5        5              

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

Copy link

github-actions bot commented Aug 12, 2024

Before [a2272cd] After [bc1c7f8] Ratio Benchmark (Parameter)
31.3±2ms 35.1±3ms ~1.12 benchmarks.AssignSingleDfToNestedSeries.time_run
1.11±0.02ms 1.12±0.02ms 1.01 benchmarks.NestedFrameReduce.time_run
283M 286M 1.01 benchmarks.ReassignHalfOfNestedSeries.peakmem_run
266M 264M 1.00 benchmarks.AssignSingleDfToNestedSeries.peakmem_run
87.2M 87.1M 1.00 benchmarks.NestedFrameAddNested.peakmem_run
90.9M 90.6M 1.00 benchmarks.NestedFrameReduce.peakmem_run
9.26±0.09ms 9.20±0.1ms 0.99 benchmarks.NestedFrameAddNested.time_run
94.2M 91.9M 0.98 benchmarks.NestedFrameQuery.peakmem_run
6.46±0.06ms 6.26±0.03ms 0.97 benchmarks.NestedFrameQuery.time_run
60.9±3ms 57.5±3ms 0.94 benchmarks.ReassignHalfOfNestedSeries.time_run

Click here to view all benchmarks.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@dougbrn dougbrn marked this pull request as ready for review August 12, 2024 21:51
@dougbrn dougbrn requested a review from wilsonbb August 12, 2024 21:53
Copy link
Contributor

@wilsonbb wilsonbb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dougbrn dougbrn merged commit 975fbc8 into main Aug 13, 2024
11 checks passed
@dougbrn dougbrn deleted the get_nested branch August 13, 2024 16:54
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.

Frame-level interface to get and set nested columns
2 participants