如这里解释
在numpy的帮助下,您可以计算出例如线性拟合。
# plot the data itselfpylab.plot(x,y,'o')# calc the trendlinez = numpy.polyfit(x, y, 1)p = numpy.poly1d(z)pylab.plot(x,p(x),"r--")# the line equation:print "y=%.6fx+(%.6f)"%(z[0],z[1])

如这里解释
在numpy的帮助下,您可以计算出例如线性拟合。
# plot the data itselfpylab.plot(x,y,'o')# calc the trendlinez = numpy.polyfit(x, y, 1)p = numpy.poly1d(z)pylab.plot(x,p(x),"r--")# the line equation:print "y=%.6fx+(%.6f)"%(z[0],z[1])