Skip to content

Index._shallow_copy does not handle data types #9170

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

Closed
behzadnouri opened this issue Dec 30, 2014 · 1 comment
Closed

Index._shallow_copy does not handle data types #9170

behzadnouri opened this issue Dec 30, 2014 · 1 comment
Labels
Internals Related to non-user accessible pandas implementation

Comments

@behzadnouri
Copy link
Contributor

integer index with float data types:

>>> i
Int64Index([1, 2], dtype='int64')
>>> i._shallow_copy(i.values.astype('f8'))
Int64Index([1.0, 2.0], dtype='float64')

another issue: an index which is not equal to its copy:

>>> i
Float64Index([1.0, 2.0], dtype='float64')
>>> j = i._shallow_copy(i.values.astype('O'))
>>> j
Float64Index([1.0, 2.0], dtype='object')
>>> j.equals(i)
False
>>> j.equals(j.copy())
False
@jreback
Copy link
Contributor

jreback commented Jan 2, 2015

this is an internal routine. I suppose the documentation could be improved. This has an implicit guarantee that the user behaves correctly. Changing the dtype is not allowed.

@jreback jreback closed this as completed Jan 2, 2015
@jreback jreback added the Internals Related to non-user accessible pandas implementation label Jan 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

No branches or pull requests

2 participants