pandas.DataFrame.cov

pandas 3.1.1 · DataFrame · method

Estimate how pairs of numeric inputs vary together from aligned observations.

Call syntax

DataFrame.cov(min_periods=None, ddof=1, numeric_only=False)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
min_periods Optional
Positional or keyword
Default None
int

Require this many valid observations in a window before pandas reports a value.

ddof Optional
Positional or keyword
Default 1
int

Set the degrees of freedom correction. The usual variance divisor is N minus ddof.

numeric_only Optional
Positional or keyword
Default False
bool

Restrict the calculation to columns pandas considers numeric where applicable.

Returns

DataFrame