摘要:
x = np.arange(0,10,0.1) def line1(x): return np.sin(x)*2 def slope(x): h = 1e-4 k = (line1(x+h)-line1(x-h))/(2*h) b = line1(x)-k*x return k,b # 通过计算导数 阅读全文
摘要:
y = np.random.random(5) print(y) idx = np.argwhere(y == np.max(y)).flatten() print(idx,y[idx]) 阅读全文