fork download
  1. import numpy as np
  2. x = np.array([0.0,1.0,2.0])
  3. y = np.array([0.0,0.8,0.9])
  4. z = np.polyfit(x,y,3)
  5. p = np.poly1d(z)
  6. y2 = [ p(N) for N in x ]
  7.  
  8. print str(y2[0])
Success #stdin #stdout #stderr 0.66s 20656KB
stdin
Standard input is empty
stdout
6.40987562128e-17
stderr
/usr/local/lib/python2.7/dist-packages/numpy/lib/polynomial.py:585: RankWarning: Polyfit may be poorly conditioned
  warnings.warn(msg, RankWarning)