eval_poly¶
- tayph.eval_poly(x, f)[source] [edit on github]¶
This evaluates a polynomial using fitting coefficients f that were found via np.polyfit(x,y). Normally you could use numpy.polynomial.polynomial.Polynomlial(fit)(x) for this, but not if fit is a 2D array found by using np.polyfit(x,Y) with Y 2D. To deal with this eval_poly evaluates a sequence of polynomials for a sequence of fits, on x. If you want to rip this out of tayph for your own purposes, all you need to remove is the test functions.
- Parameters
- xnp.ndarray
A 1D array with x values.
- fnp.ndarray
A 1D or 2D array containing polynomial coefficients.