Skip to content

BUG: DataFrame.apply axis=1 for str ops with no axis argument #39211

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
rhshadrach opened this issue Jan 16, 2021 · 0 comments · Fixed by #39212
Closed

BUG: DataFrame.apply axis=1 for str ops with no axis argument #39211

rhshadrach opened this issue Jan 16, 2021 · 0 comments · Fixed by #39212
Assignees
Labels
Apply Apply, Aggregate, Transform, Map Bug
Milestone

Comments

@rhshadrach
Copy link
Member

E.g.

df = pd.DataFrame({'a': [1, 2], 'b': [3, 4]})
print(df.apply('pct_change', axis=0))
print(df.apply('pct_change', axis=1))

both give the output

     a         b
0  NaN       NaN
1  1.0  0.333333

This should instead raise rather than silently give incorrect results.

@rhshadrach rhshadrach added Bug Apply Apply, Aggregate, Transform, Map labels Jan 16, 2021
@rhshadrach rhshadrach self-assigned this Jan 16, 2021
@jreback jreback added this to the 1.3 milestone Jan 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apply Apply, Aggregate, Transform, Map Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants