Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Curve-fitting, trend-line, regression?

Any idea or available example of curve-fitting (similar to trend-lines in an excel charts)?

It can be done using Python function: scipy.optimize.curve_fit(f, xdata, ydata)

I have ydata (i.e. apple stock price) but how to get xdata as the dates/time and give it curve_fit function?

Any help is really appreciated.

Thank you