python linear regression predict by date

前端 未结 5 1963
旧时难觅i
旧时难觅i 2021-01-01 22:34

I want to predict a value at a date in the future with simple linear regression, but I can\'t due to the date format.

This is the dataframe I have:



        
5条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-01 22:55

    Liner regression works on numerical data. Datetime type is not appropriate for this case. You should remove that column after separating it to three separate columns (year, month and day).

提交回复
热议问题