I am new to Python and looking for help to multiply 2 dataframes over time. Any help to understand the error would be highly appreciated.
First DataFrame (cov)
Date NoDur Durbl Manuf
2018-12-27 NoDur 0.000109 0.000112 0.000118
Durbl 0.000112 0.000339 0.000238
Manuf 0.000118 0.000238 0.000246
2018-12-28 NoDur 0.000109 0.000113 0.000117
Durbl 0.000113 0.000339 0.000239
Manuf 0.000117 0.000239 0.000242
2018-12-31 NoDur 0.000109 0.000113 0.000118
Durbl 0.000113 0.000339 0.000239
Manuf 0.000118 0.000239 0.000245
Second DataFrame (w)
Date NoDur Durbl Manuf
2018-12-27 -69.190732 -96.316224 -324.058486
2018-12-28 -113.831750 30.426696 -410.055587
2018-12-31 -101.365016 -16.613136 -362.232014
the code:
std = np.dot(np.transpose(w) , np.matmul(cov , w))
the error:
ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 12361 is different from 10)
I only show small extracts from the dataframes. The original cov dataframe is 123610 rows × 10 columns, the w dataframe 12361 rows × 10 columns.
Expected output:
Date
2018-12-27 44.45574103083
2018-12-28 46.593367859
2018-12-31 45.282932300
Many thanks in advance!!