Skip to content

BUG: dataframe returned for alternative agg method call np.size and "size" are inconsistent #48328

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
wants to merge 1 commit into from

Conversation

ntachukwu
Copy link
Contributor

@ntachukwu
Copy link
Contributor Author

import pandas as pd
import numpy as np

df = pd.DataFrame(columns=['a', 'b'])

# These return equal objects
df.agg({'a':['mean','std']})
df.agg({'a':[np.mean,np.std]})

# This does not
df.agg({'a': ['size']})
df.agg({'a': [np.size]})

@ntachukwu
Copy link
Contributor Author

This isn't peculiar to empty inputs. And is a duplicate of #42203. I will be closing this draft PR.

@ntachukwu ntachukwu closed this Sep 2, 2022
@ntachukwu ntachukwu deleted the agg_empty_input branch September 2, 2022 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API: Specify the behaviour for operating on empty objects
1 participant