Skip to content
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

BUG: Describe is giving me different std. #40344

Closed
2 of 3 tasks
ninjakx opened this issue Mar 10, 2021 · 1 comment
Closed
2 of 3 tasks

BUG: Describe is giving me different std. #40344

ninjakx opened this issue Mar 10, 2021 · 1 comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@ninjakx
Copy link

ninjakx commented Mar 10, 2021

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


Pandas Version:
pandas==1.1.0

Data file: penguins1@csv

df.head(10).describe()

gives me:
s4

std value for bill_length_mm is around 2

df.head(10)['bill_length_mm'].values
result in:
`array([39.1, 39.5, 40.3, nan, 36.7, 39.3, 38.9, 39.2, 34.1, 42. ])

import numpy as np
x = [39.1, 39.5, 40.3,  0, 36.7, 39.3, 38.9, 39.2, 34.1, 42. ]
np.std(x, ddof=1)

gives:

12.445923027240687

pd.Series(x).std() gives 12.445923027240687 (same)

but why describe is giving me 2??

`

@ninjakx ninjakx added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Mar 10, 2021
@ninjakx
Copy link
Author

ninjakx commented Mar 10, 2021

When I have nan in x = [39.1, 39.5, 40.3, np.nan, 36.7, 39.3, 38.9, 39.2, 34.1, 42. ] then my series gives me 2.2357573909329043

@ninjakx ninjakx closed this as completed Mar 10, 2021
@phofl phofl added this to the No action milestone Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

2 participants