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: Series.to_frame #43558

Merged
merged 3 commits into from
Sep 14, 2021
Merged

PERF: Series.to_frame #43558

merged 3 commits into from
Sep 14, 2021

Conversation

jbrockmendel
Copy link
Member

import pandas as pd

ser = pd.Series(range(5))

%timeit ser.to_frame()

%prun -s cumtime for n in range(10000): ser.to_frame()
9.71 µs ± 501 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)   # <- PR
33.2 µs ± 651 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)  # <- master

@jreback jreback added this to the 1.4 milestone Sep 14, 2021
@jreback jreback added Performance Memory or execution speed performance Constructors Series/DataFrame/Index/pd.array Constructors Series Series data structure labels Sep 14, 2021
@jreback jreback merged commit d3c8e87 into pandas-dev:master Sep 14, 2021
@jbrockmendel jbrockmendel deleted the perf-to_frame branch September 14, 2021 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Constructors Series/DataFrame/Index/pd.array Constructors Performance Memory or execution speed performance Series Series data structure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants