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

perf: avoid merge in pandas groupby #1638

Merged

Conversation

MarcoGorelli
Copy link
Member

What type of PR is this? (check all applicable)

  • πŸ’Ύ Refactor
  • ✨ Feature
  • πŸ› Bug Fix
  • πŸ”§ Optimization
  • πŸ“ Documentation
  • βœ… Test
  • 🐳 Other

Related issues

  • Related issue #<issue number>
  • Closes #<issue number>

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

If you have comments or can explain your changes, please do so below

@MarcoGorelli MarcoGorelli force-pushed the avoid-merge-in-pandas-groupby branch from 305258d to c0b6dbe Compare December 21, 2024 10:29
@MarcoGorelli
Copy link
Member Author

@FBruzzesi this gives a very minor (5%) perf boost if I time it locally - but more importantly, I think using horizontal_concat may make it easier to extend if std aggregations need doing separately?

@FBruzzesi
Copy link
Member

Neat! As long as group by order is guaranteed, this is safe to merge πŸ‘Œ and definitly helpful for integrating std/var ops

@MarcoGorelli MarcoGorelli marked this pull request as ready for review December 21, 2024 11:30
@MarcoGorelli
Copy link
Member Author

Neat! As long as group by order is guaranteed, this is safe to merge πŸ‘Œ and definitly helpful for integrating std/var ops

it doesn't need to be 😎 because the keys are part of the index, and concat aligns on the index anyway. this is the one good use case for the index πŸ˜„

@MarcoGorelli MarcoGorelli merged commit 15d22e3 into narwhals-dev:main Dec 22, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants