Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168730
Image: ubuntu2004
import numpy as np
x = np.array([1,2.1, 3,4,7,8,9.6], dtype=float) y = np.array([4.41,4.42 ,3.2, 3, 3.98, 4.4, 4], dtype=float) pf = np.poly1d(np.polyfit(x,y, 3)) html('<pre>' + str(pf) + '</pre>') P0 = list_plot(zip(x,y), rgbcolor='red') P1 = list_plot([(i,pf(i)) for i in np.linspace(int(0),int(10),100)],plotjoined=True) show(P0 + P1)
          3          2
-0.01767 x + 0.3283 x - 1.734 x + 6.111