Skip to content

Mean is incorrectly NaN in 'object' DataFrame #676

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
craustin opened this issue Jan 24, 2012 · 3 comments
Closed

Mean is incorrectly NaN in 'object' DataFrame #676

craustin opened this issue Jan 24, 2012 · 3 comments
Labels
Milestone

Comments

@craustin
Copy link

from pandas import DataFrame
df = DataFrame({0: [np.nan, 2], 1: [np.nan, 3], 2: [np.nan, 4]}, dtype=object)
df.mean(1)

Expected:
In [33]: df.mean(1)
Out[33]:
0 NaN
1 3.0

Actual:
In [31]: df.mean(1)
Out[31]:
0 NaN
1 NaN

wesm added a commit that referenced this issue Jan 24, 2012
@wesm
Copy link
Member

wesm commented Jan 24, 2012

thanks, fixed in the above commit

@wesm wesm closed this as completed Jan 24, 2012
@james18
Copy link

james18 commented Jan 27, 2012

Will this fix apply to the DataFrame.std() function as well?

@wesm
Copy link
Member

wesm commented Jan 27, 2012

pretty sure I fixed it and added a test for it in the above commit

dan-nadler pushed a commit to dan-nadler/pandas that referenced this issue Sep 23, 2019
Multiple small formatting changes and enabling pycodestyle in ci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants