Skip to content

perf(python): Speed up from_pandas when converting frame with multi-index columns #21063

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

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

aberres
Copy link
Contributor

@aberres aberres commented Feb 3, 2025

[Sorry for screenshots instead of code - I do not have much time right now. I can tweak this PR later if needed.]

Given a frame like this:

CleanShot 2025-02-03 at 21 31 31@2x

Without the patch:

CleanShot 2025-02-03 at 21 34 00@2x

With the patch:

CleanShot 2025-02-03 at 21 33 21@2x

@github-actions github-actions bot added performance Performance issues or improvements python Related to Python Polars rust Related to Rust Polars labels Feb 3, 2025
@aberres
Copy link
Contributor Author

aberres commented Feb 3, 2025

After:

CleanShot 2025-02-03 at 21 40 14@2x

Before:

CleanShot 2025-02-03 at 21 41 41@2x

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.26%. Comparing base (e950592) to head (182d37d).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21063      +/-   ##
==========================================
- Coverage   79.27%   79.26%   -0.01%     
==========================================
  Files        1585     1585              
  Lines      225622   225622              
  Branches     2588     2588              
==========================================
- Hits       178858   178840      -18     
- Misses      46174    46192      +18     
  Partials      590      590              

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

@ritchie46 ritchie46 changed the title perf: Speed up from_pandas when converting frame with multi-index columns perf(python): Speed up from_pandas when converting frame with multi-index columns Feb 4, 2025
@ritchie46
Copy link
Member

Thanks!

@ritchie46 ritchie46 merged commit 76d5e4d into pola-rs:main Feb 4, 2025
14 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance issues or improvements python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants