Square Pythons

A reference for using the polyfit is here at scipy.



import numpy as np import matplotlib.pyplot as plt powers_x=4 array_size=5 a1=[] a2=[] for s in xrange(array_size): a1.append(s**2) a2.append(s) k=np.polyfit(a1,a2,powers_x) inds = np.arange(powers_x+1) fig = plt.figure() ax=fig.add_subplot(111) ax.plot(inds,k )

Now fitting the curve using poly1d.

0 comments:

Automated Intelligence

Automated Intelligence
Auftrag der unendlichen LOL katzen