📌  相关文章
📜  为什么我会得到 TypeError:不能将序列乘以“浮点”类型的非整数? - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:13.903000             🧑  作者: Mango

代码示例1
import math
import numpy as np
alpha = 0.2 
beta=1-alpha
C = (-math.log(1-beta))/alpha
coff = [0.0,0.01,0.0,0.35,0.98,0.001,0.0]

# Not working
coff = coff*C
# Working -> convert the list to numpy array:
coff = np.asarray(coff) * C