摘要: 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 # 通过计算导数 阅读全文
posted @ 2021-11-06 21:27 华小电 阅读(242) 评论(0) 推荐(0) 编辑
摘要: y = np.random.random(5) print(y) idx = np.argwhere(y == np.max(y)).flatten() print(idx,y[idx]) 阅读全文
posted @ 2021-11-06 20:45 华小电 阅读(379) 评论(0) 推荐(0) 编辑