I'm trying to calculate variance from covariance matrix and the proportions of each stocks. Here's my code:
for num in range(9):
result_table2.iloc[num]['Expected Return'] = arith_mean.dot(result_table1.iloc[num])
for num in range(9):
result_table2.iloc[num]['Standard Deviation'] = (result_table1.iloc[num])@V.values
The first one worked and the second one failed
result_table1:
result_table2:
covariance matrix: