#2529·prophet

Model fit behaves very differently between `datetime64[ns]` and `datetime64[ms]`.

Author: secondtomCreated Nov 17, 2023Updated Dec 3, 2025

I was unknowingly passing a dtype of datetime64[ms] to prophet and getting a very poor fit. Converted back to datetime64[ns] and model fit behaved as expected. It might be worth adding a check to warn other users.

My approach to convert was: df['ds'] = pd.to_datetime(df['ds'].dt.strftime('%Y-%m-%d'))

NB: A possible cause of getting the [ms] type is converting from a polars frame.