Skip to content

DOC: ddof in cov when nans present #47042

Closed
@attack68

Description

@attack68

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

.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions