1

I am trying to run a linear regression with the Tesla stock prices as the dependent variable and the date as the independent variable. But I cannot do this as I need to convert the date into an integer of some sort in order to run the regression. Would anyone know how I can do this?

This is the data I am working with:

Tesla Stock Prices after Stock Split

enter image description here

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • This question seems to have already been answered over here: https://stackoverflow.com/questions/24588437/convert-date-to-float-for-linear-regression-on-pandas-data-frame. You might want to consider the post's answer and then delete the question if the answer works for you. – Akilan Manivannan Apr 23 '21 at 04:42
  • thank you for your reply :) i tried these and it still did not work, any suggestions? – user15744204 Apr 23 '21 at 06:06

0 Answers0