-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
API: Deep copy not copying index/columns #4202
Comments
@jreback do you see the index.name thing? apparently not everyone does (my computer is sulking today, so not trusting it): http://stackoverflow.com/a/17591435/1240268 |
Ah I see, I think that is being done after (which creates a new object):
|
Btw - this should be resolved by shallow copying indices, since they are supposed to be mostly immutable. That allows you to change metadata. After #4039, MultiIndex and Index will handle this transparently when copied with |
Yes. |
@hayd I believe this is all fixed and can be closed, yes? |
@jtratner test is this:
|
I will fix that. |
@jreback Where is the best opportunity to actually copy an index (both for rows and columns) with the block manager? I think it just needs to be shallow or deep-copied each time and then passed as the new |
right now there is NO deep copying of the index in BM. I think you just need to change
|
@jreback ah okay, there it is...now I remember we were hitting this issue before too...need to make sure the ref_items get passed to the copy constructor. I think this copy needs a separate kwarg for whether index should be deep copied (because, generally, index always needs to be shallow copied). |
@jtratner I don't know, I think easist just to copy everything on deep copy? |
http://stackoverflow.com/questions/17591104/in-pandas-can-i-deeply-copy-a-dataframe-including-its-index-and-column/17591423#17591423
This means if we change the index in place, e.g. with name:
This changes the name of the df.index.
The text was updated successfully, but these errors were encountered: