Skip to content

Apply Across Non-Unique Indices. #1878

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

Closed
theandygross opened this issue Sep 10, 2012 · 0 comments
Closed

Apply Across Non-Unique Indices. #1878

theandygross opened this issue Sep 10, 2012 · 0 comments
Labels
Milestone

Comments

@theandygross
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants