Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168729
Image: ubuntu2004
from numpy import * from scipy import * vp = array([1.0, 5.0, 10.0, 20.0, 40.0, 60.0, 100.0, 200.0, 400.0, 760.0], dtype=float) T = array([-36.7, -19.6, -11.5, -2.6, 7.6, 15.4, 26.1, 42.2, 60.6, 80.1], dtype=float) pf = poly1d(polyfit(vp,T,3)) html('<pre>' + str(pf) + '</pre>') P0 = list_plot(vp,T, rgbcolor='red') P1 = list_plot([(i,pf(i)) for i in linspace(int(-30),int(800),800)],plotjoined=True) show(P0 + P1)
           3           2
1.131e-06 x - 0.00149 x + 0.6128 x - 21.39
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/sage/sagenb/sage_notebook/worksheets/slybro/0/code/2.py", line 13, in <module> P0 = list_plot(vp,T, rgbcolor='red') File "/home/sage/sage/local/lib/python2.5/site-packages/sage/plot/plot.py", line 1861, in list_plot if plotjoined: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()