Skip to content

df.applymap duplicates data with frame has dupe columns #2786

Closed
@vincentarelbundock

Description

@vincentarelbundock

Using pandas master/github. In this example, we get 4 times the same column after applying an element-wise operation:

In [1]: import numpy as np
In [2]: import pandas as pd
In [3]: df = pd.DataFrame(np.random.random((3,4)))
In [4]: cols = pd.Index(['a','a','a','a'])
In [5]: df.columns = cols
In [6]: df.applymap(str)
Out[6]: 
                a               a               a               a
0  0.320051885413  0.320051885413  0.320051885413  0.320051885413
1  0.967238549103  0.967238549103  0.967238549103  0.967238549103
2  0.913201809648  0.913201809648  0.913201809648  0.913201809648

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions