This is the part of my code, why it shows** :ValueError**: operands could not be broadcast together with shapes (3,) (1000,)

prets = []
pvols = []
for p in range (2500):
weights = np.random.random(noa)
weights /= np.sum(weights)
prets.append(np.sum(data.mean() * weights) * 252)
pvols.append(np.sqrt(np.dot(weights.T,
np.dot(data.cov() * 252, weights))))
pret = np.array(prets)
pvol = np.array(pvols)