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: unstack #44758

Merged
merged 10 commits into from
Dec 6, 2021
Merged

PERF: unstack #44758

merged 10 commits into from
Dec 6, 2021

Conversation

jbrockmendel
Copy link
Member

from asv_bench.benchmarks.reshape import *
self = Unstack()
self.setup("category")

%timeit self.time_without_last_row("category")
77.3 ms ± 1.97 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)  # <- master
21.2 ms ± 788 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)  # <- PR

@jreback jreback added Performance Memory or execution speed performance Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Dec 4, 2021
@jreback jreback added this to the 1.4 milestone Dec 4, 2021
)
for i, (indices, place) in enumerate(zip(new_values, new_placement))
]
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm can you avoid repeating this? (e.g. could create a needs_masking[i] with all values == False for the not allow_fill case

Copy link
Member Author

Choose a reason for hiding this comment

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

sure

@jreback jreback merged commit 9f48b88 into pandas-dev:master Dec 6, 2021
@jreback
Copy link
Contributor

jreback commented Dec 6, 2021

nice!

@jbrockmendel jbrockmendel deleted the perf-unstack branch December 6, 2021 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Memory or execution speed performance Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants