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

DOC: Modify astype copy=False example to work across platforms #18865

Merged
merged 1 commit into from
Dec 21, 2017

Conversation

jschendel
Copy link
Member

  • passes git diff upstream/master -u -- "*.py" | flake8 --diff

Very minor, just changed 'int' -> 'int64'.

The example as previously written does not work on Windows, since astype('int') converts to int32 instead of int64. The Series constructor defaults to int64, so on Windows the astype ends up making a copy since the dtype changes, and thus the propagation to s1 doesn't occur.

This shouldn't impact Linux or Mac, since astype('int') converts to int64 on those platforms, so astype('int64') should be equivalent. I suppose this might not work for people using 32 bit distributions (?), but this should have wider coverage of potential readers of the docs, and is less confusing than using something like 'intp'.

@jreback jreback added the Docs label Dec 20, 2017
@jreback jreback added this to the 0.22.0 milestone Dec 20, 2017
@jreback jreback merged commit 554472f into pandas-dev:master Dec 21, 2017
@jreback
Copy link
Contributor

jreback commented Dec 21, 2017

thanks!

@jschendel jschendel deleted the doc-astype-copy branch December 21, 2017 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants