Skip to content

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

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 11, 2021 · 0 comments · Fixed by #39118
Closed

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

rhshadrach opened this issue Jan 11, 2021 · 0 comments · Fixed by #39118
Assignees
Labels
API - Consistency Internal Consistency of API/Behavior Apply Apply, Aggregate, Transform, Map Enhancement
Milestone

Comments

@rhshadrach
Copy link
Member

rhshadrach commented Jan 11, 2021

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.

@rhshadrach rhshadrach added Enhancement API - Consistency Internal Consistency of API/Behavior labels Jan 11, 2021
@rhshadrach rhshadrach self-assigned this Jan 11, 2021
@rhshadrach rhshadrach added the Apply Apply, Aggregate, Transform, Map label Jan 11, 2021
@rhshadrach rhshadrach changed the title DataFrame.apply doesn't handle numpy ops DataFrame.apply doesn't handle numpy ops or DataFrame properties Jan 11, 2021
@jreback jreback added this to the 1.3 milestone Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Consistency Internal Consistency of API/Behavior Apply Apply, Aggregate, Transform, Map Enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants