Skip to content

CLN: use getvalue() instead of seek(0)+read() #39213

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
Jan 19, 2021
Merged

CLN: use getvalue() instead of seek(0)+read() #39213

merged 1 commit into from
Jan 19, 2021

Conversation

twoertwein
Copy link
Member

BytesIO's getvalue() is the same as seek(0) followed by read() if the buffer is not used in any other place (getvalue doesn't change the position within the buffer). getvalue is slightly faster then seek+read.

@jreback jreback added Clean IO Stata read_stata, to_stata labels Jan 19, 2021
@jreback jreback added this to the 1.3 milestone Jan 19, 2021
@jreback jreback merged commit 91433f8 into pandas-dev:master Jan 19, 2021
@jreback
Copy link
Contributor

jreback commented Jan 19, 2021

thanks @twoertwein

@twoertwein twoertwein deleted the getvalue branch January 19, 2021 21:19
nofarm3 pushed a commit to nofarm3/pandas that referenced this pull request Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean IO Stata read_stata, to_stata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants