Skip to content

Conversation

seth-p
Copy link
Contributor

@seth-p seth-p commented May 12, 2015

Closes #10115.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is for dealing with the API differences between Index and MultiIndex, yes? I think it would be cleaner to override the method on MultiIndex.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. OK, I can do that.

Alternatively, it would be great if the constructors of all Index subclasses (other than MultiIndex) accepted a names list of length one and used it to set name. That way one could always just set names without worrying about it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would even be happy if you just explicitly check isinstance(self, MultiIndex).

I agree that your alternative solution would be preferable. That's part of a much bigger issue: #3268

@jreback jreback added Bug Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex labels May 13, 2015
@jreback jreback added this to the 0.17.0 milestone May 13, 2015
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can dispense with this with a

return self._shallow_copy(result), should handle all meta-data

e.g. this will propogate things like freq/tz, etc as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

though looking at this now, I think MultiIndex._shallow_copy is wrong

let me see if I can fix this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jreback
Copy link
Contributor

jreback commented May 21, 2015

@seth-p can you rebase and update?

@seth-p
Copy link
Contributor Author

seth-p commented Jun 16, 2015

Afraid I do not have time to work on this. Could someone else handle it?

@sinhrks
Copy link
Member

sinhrks commented Jun 16, 2015

@seth-p OK, will do.

@seth-p seth-p deleted the drop_duplicates_names branch August 7, 2015 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: MultiIndex.drop_duplicates() drops names

4 participants