Skip to content

DataFrame.apply doesn't handle numpy ops or DataFrame properties #39116

Closed
@rhshadrach

Description

@rhshadrach
s = pd.Series([1, 2])
df = pd.DataFrame([1, 2])

print(s.agg("sqrt"))
print(df.agg("sqrt"))
print(s.apply("sqrt"))
print(df.apply("sqrt"))

print(s.agg("size"))
print(df.agg("size"))
print(s.apply("size"))
print(df.apply("size"))

In each of the two blocks, first three lines all give the expected output and the last raises.

Metadata

Metadata

Assignees

Labels

API - ConsistencyInternal Consistency of API/BehaviorApplyApply, Aggregate, Transform, MapEnhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions