From 2196d086442b9321f923308d8a573cb0de5f00ce Mon Sep 17 00:00:00 2001 From: Kaiwen Shen 1F8 <33817547+10315619@users.noreply.github.com> Date: Mon, 15 Aug 2022 02:27:21 +0100 Subject: [PATCH] Update ipca.py strangely my script is getting ValueError: could not broadcast input array from shape (52,1) into shape (52,) error, reason unknown but this is a hot fix. numpy version =='1.21.6' --- ipca/ipca.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipca/ipca.py b/ipca/ipca.py index 15bbee2..ad95339 100644 --- a/ipca/ipca.py +++ b/ipca/ipca.py @@ -1429,7 +1429,7 @@ def _build_portfolio(X, y, indices, metad): for t in range(T): ixt = (indices[:, 1] == t) val_obs[t] = np.sum(ixt) - Q[:, t] = X[ixt, :].T.dot(y[ixt])/val_obs[t] + Q[:, t] = (X[ixt, :].T.dot(y[ixt])/val_obs[t]).shape(-1,) W[:, :, t] = X[ixt, :].T.dot(X[ixt, :])/val_obs[t] bar.update(t)