Examples
import numpy as np
import pandas as pd
df = pd.DataFrame([(2, 3), (0, 4), (2, 0), (2, 2)],
... columns=['deers', 'goats'])
df.cov()
np.random.seed(42)
df = pd.DataFrame(np.random.randn(800, 4),
columns=['p', 'q', 'r', 's'])
df.cov()
Minimum number of periods
np.random.seed(42)
df = pd.DataFrame(np.random.randn(21, 3),
columns=['p', 'q', 'r'])
df.loc[df.index[:3], 'p'] = np.nan
df.loc[df.index[3:10], 'q'] = np.nan
df.cov(min_periods=12)