Skip to content

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

Closed
@rhshadrach

Description

@rhshadrach

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.

Metadata

Metadata

Assignees

Labels

ApplyApply, Aggregate, Transform, MapBug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions