我尝试使用Python分析来自不同文件的数据。所以我使用了一个函数,如下所示:def multi_estimate(a , b):
ids = np.linspace(0.3 , 0.7 ,num = 17, endpoint = True) #files name identifier
for i in ids:
dat = np.loadtxt('Qn'+ str(int(i*1000))+'.txt') # reading filename
q = np.array(dat[:,1]); # take the second column
x , y = hurst(q); # calculate lags and R/S values for Hurst exponent
coef = linear_fit(x, y , a , b) # make a linear fit and estimate slope
return None
在我的线性拟合函数中,我正在绘制结果,因为我想检查拟合是否正确,点是否在一条直线上。如果做得不好,我想通过在函数中添加一些代码来进行新的调整。我的问题是,在执行过程中,只有当for循环结束时,才会出现空图形并填充绘图。在
我怎样才能让每一个情节都出现在第一步,检查它,然后继续下一个呢?在
我的拟合函数是:
^{pr2}$