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

Propagate index name in to_flat #27

Merged
merged 5 commits into from
Apr 15, 2024
Merged

Propagate index name in to_flat #27

merged 5 commits into from
Apr 15, 2024

Conversation

wilsonbb
Copy link
Contributor

@wilsonbb wilsonbb commented Apr 12, 2024

Change Description

Currently when we use to_flat on a packed dataframe the name of its original index (which still exists in its pandas series form) is lost. See the following notebook screenshot

Screenshot 2024-04-12 at 9 45 36 AM

This can be fixed by simply having to_flat reference the previous index name when creating its result dataframe.

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

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

Project-Specific Pull Request Checklists

Bug Fix Checklist

  • My fix includes a new test that breaks as a result of the bug (if possible)
  • My change includes a breaking change
    • My change includes backwards compatibility and deprecation warnings (if possible)

@wilsonbb wilsonbb marked this pull request as ready for review April 12, 2024 17:09
Copy link

github-actions bot commented Apr 12, 2024

Before [d63cee9] After [9f36add] Ratio Benchmark (Parameter)
3.79±0.5s 2.18±1s ~0.58 benchmarks.time_computation
1.22k 1.94k 1.58 benchmarks.mem_list

Click here to view all benchmarks.

@wilsonbb wilsonbb requested a review from hombit April 12, 2024 17:10
Copy link

codecov bot commented Apr 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.92%. Comparing base (d63cee9) to head (af5951f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #27   +/-   ##
=======================================
  Coverage   94.92%   94.92%           
=======================================
  Files          13       13           
  Lines         611      611           
=======================================
  Hits          580      580           
  Misses         31       31           

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

Copy link
Collaborator

@hombit hombit left a comment

Choose a reason for hiding this comment

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

Thank you! TIL about index names

src/nested_pandas/series/accessor.py Outdated Show resolved Hide resolved
@wilsonbb wilsonbb requested a review from hombit April 12, 2024 18:25
@wilsonbb wilsonbb merged commit 1818c57 into main Apr 15, 2024
11 checks passed
@wilsonbb wilsonbb deleted the index branch April 15, 2024 16:52
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.

2 participants