Back to Community
Calculating beta matrix

Hi,

With pandas calculating correlation matrix is quite easy, you just use df.corr(). Same with covariance ie df.cov().

Does anyone know how to calculate matrix for beta? Thanks in advance.

1 response

I think the answer for this question is

df.cov() / df.var()