Skip to content

Apply Across Non-Unique Indices. #1878

@theandygross

Description

@theandygross

Applying a function across a data-frame does not seem to work for non-unique indices.

df = pandas.DataFrame([[1,1,1], [2,2,2], [3,3,3]], index=['a','a','c'])
df.apply(lambda s: s[0], axis=1)

a    2
a    2
c    3

It seems to be just returning the value for the first instance of the index.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions