Data.polyfit(xcol=None, ycol=None, polynomial_order=2, bounds=<function FittingMixin.<lambda>>, result=None, replace=False, header=None)

Pass through to numpy.polyfit.

  • xcol (index) – Index to the column in the data with the X data in it

  • ycol (index) – Index to the column int he data with the Y data in it

  • polynomial_order (int) – Order of polynomial to fit (default 2)

  • bounds (callable) – A function that evaluates True if the current row should be included in the fit

  • result (index or None) – Add the fitted data to the current data object in a new column (default don’t add)

  • replace (bool) – Overwrite or insert new data if result is not None (default False)

  • header (string or None) – Name of column_header of replacement data. Default is construct a string from the y column headser and polynomial order.


(numpy.poly) – The best fit polynomial as a numpy.poly object.


If the x or y columns are not specified (or are None) the the setas attribute is used instead.

This method is depricated and may be removed in a future version in favour of the more general