Could we maybe use python's integer type instead of scipy's int32?
for j in xrange(0, int(weights[i]))