Skip to content

DOC: ddof in cov when nans present #47042

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
1 task done
attack68 opened this issue May 17, 2022 · 4 comments · Fixed by #52137
Closed
1 task done

DOC: ddof in cov when nans present #47042

attack68 opened this issue May 17, 2022 · 4 comments · Fixed by #52137

Comments

@attack68
Copy link
Contributor

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.cov.html

Documentation problem

The ddof argument is applicable only when nans are not present in the dataframe.
It can be quite common to calculate a covariance matrix from financial data where the last row might be nan since the difference is taken between values. One might expect that since the result is given the ddof is adhered to. But it is not. I think this should be explicitly stated in the argument documentation, rather than hidden in the notes.

Suggested fix for documentation

.

@attack68 attack68 added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels May 17, 2022
@topper-123 topper-123 added good first issue and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Mar 22, 2023
@topper-123
Copy link
Contributor

Yeah, if would fine to have mentioned in the ddof doc line. Contributions welcome.

@ma-ma-hima
Copy link
Contributor

take

@ma-ma-hima
Copy link
Contributor

@attack68 @topper-123
May I add the following text?

The ddof argument is applicable only when nans are not present in the dataframe.

@topper-123
Copy link
Contributor

I think that's a good line to add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants