搜索到与相关的文章
Python

在python tkinter中Canvas实现进度条显示的方法

如下所示:fromtkinterimport*importtime#更新进度条函数defchange_schedule(now_schedule,all_schedule):canvas.coords(fill_rec,(5,5,6+(now_schedule/all_schedule)*100,25))root.update()x.set(str(round(now_schedule/all_schedule*100,2))+'%')ifround(no

系统 2019-09-27 17:51:22 2620

Python

python之拟合的实现

一、多项式拟合多项式拟合的话,用的的是numpy这个库的polyfit这个函数。那么多项式拟合,最简单的当然是,一次多项式拟合了,就是线性回归。直接看代码吧importnumpyasnpdeflinear_regression(x,y):#y=bx+a,线性回归num=len(x)b=(np.sum(x*y)-num*np.mean(x)*np.mean(y))/(np.sum(x*x)-num*np.mean(x)**2)a=np.mean(y)-b*n

系统 2019-09-27 17:48:43 2620

编程技术

验证码