Skip to content

DataFrame.rename renames wrong elements #4980

Closed
@fonnesbeck

Description

@fonnesbeck

When specifying a dictionary map for renaming the index of a DataFrame, the renaming ends up including column values as well, even when they are not of the same type. For example, in the screen shot below, I have demographic information on race coded as integers 1-7 that I am remapping to string representations, and boolean values for the column headers specifying case status. When I specify a dictionary of mappings from integers to strings as the index argument, it treats the True value in the column header as a 1 and substitutes it.

screen shot 2013-09-25 at 9 39 12 am

Even if I specify value for columns it does not change the behavior.

Metadata

Metadata

Labels

BugDtype ConversionsUnexpected or buggy dtype conversionsrename.rename, .rename_axis

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions