Tutorials References Exercises Sign Up Menu
Create Website Get Certified Pro

Pandas DataFrame cov() Method

❮ DataFrame Reference


Find the covariance for each column in the DataFrame:

import pandas as pd

data = [[5, 6, 7], [2, 6, 9]]

df = pd.DataFrame(data)

Try it Yourself »

Definition and Usage

The cov() method finds the covariance of each column in a DataFrame.


dataframe.cov(min_periods, ddof)


The min_periods and ddof parameters are keyword arguments.

Parameter Value Description
min_periods Number Optional. Specifies the minimum number of observations required to return a good enough result
ddof Number Optional. Specifies the delta degrees of freedom. Default 1

 Return Value

A DataFrame object with the results.

This function does NOT make changes to the original DataFrame object.

❮ DataFrame Reference