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

pivot_table() to groupby().agg() #9

Open
baziotis opened this issue Jul 31, 2023 · 0 comments
Open

pivot_table() to groupby().agg() #9

baziotis opened this issue Jul 31, 2023 · 0 comments
Labels
pattern A pattern that Dias does not already rewrite into a faster version.

Comments

@baziotis
Copy link
Collaborator

Instance of the original version

# Example:
df.pivot_table(index='Survived', values='Age', aggfunc='sum')

Instance of the faster version

# Example:
df.groupby('Survived').agg({'Age': 'sum'})

This is about 3x faster on the titanic dataset. We need to test more.

@baziotis baziotis added the pattern A pattern that Dias does not already rewrite into a faster version. label Jul 31, 2023
@baziotis baziotis changed the title pivot_table to groupby().agg() pivot_table() to groupby().agg() Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pattern A pattern that Dias does not already rewrite into a faster version.
Projects
None yet
Development

No branches or pull requests

1 participant