understanding experimental data model for an exponentially distributed set of data pointsas illustrated by the code in figure we use polyfit to find curve that fits the values and log of the values notice that we use yet another python standard library modulemathwhich supplies log function import math #define an arbitrary exponential function def ( )return *( **( * )def createexpdata(fxvals)"""asssumes is an exponential function of one argument xvals is an array of suitable arguments for returns array containing results of applying to the elements of xvals""yvals [for in range(len(xvals))yvals append( (xvals[ ])return pylab array(xvals)pylab array(yvalsdef fitexpdata(xvalsyvals)"""assumes xvals and yvals arrays of numbers such that yvals[ = (xvals[ ]returns abbase such that log( ( )base=ax ""logvals [for in yvalslogvals append(math log( )#get log base , pylab polyfit(xvalslogvals return ab xvalsyvals createexpdata(frange( )pylab plot(xvalsyvals'ro'label 'actual values'abbase fitexpdata(xvalsyvalspredictedyvals [for in xvalspredictedyvals append(base**( * )pylab plot(xvalspredictedyvalslabel 'predicted values'pylab title('fitting an exponential function'pylab legend(#look at value for not in original data print ' ( =' ( print 'predicted ( ='base**( * bfigure using polyfit to fit an exponential distribution when runthis code produces the plot on the rightin which the actual values and the predicted values coincide moreoverwhen the model is tested on value ( that was not used to produce the fitit prints ( predicted (