How solve can't multiply sequence by non-int of type 'float'?

Viewed 27

why on w*v show: can't multiply sequence by non-int of type 'float'

v=[]
#Inisialisasi velocity swarm
for i in range(Np):
    L=[]
    for j in range(dim):
        L.append(np.random.random()*(vmax[j]-(-vmax[j]))+(-vmax[j]));
    v.append(L)
print("v=",np.array(v))

#Update velocity
R1=np.random.random([Np,dim]);
R2=np.random.random([Np,dim]);
#Update Kecepatan
v=w*v+c1*(R1*(Z-z))+c2*(R2*(Ztopi-z));
print(v)
0 Answers
Related