facebook / prophet

Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.
https://facebook.github.io/prophet
MIT License
18.48k stars 4.53k forks source link

ufunc 'true_divide' not supported for the input types #750

Closed DanyangSu closed 5 years ago

DanyangSu commented 5 years ago

screen shot 2018-11-23 at 12 42 29 am Hi I am trying to use the fb model, and I run into this error. After some diagnosis, it seems the issue is with pandas version. when I use 0.20.1, everything seems fine, but when I use 0.23.4, I got the error. Since I am trying to use newer version of pandas to accommodate other packages, is it possible to have Prophet accommodate to it as well?

DanyangSu commented 5 years ago

A quick update, it has nothing to do with pandas version. Changing the version caused another issue that occurred before invoking Prophet.

bletham commented 5 years ago

@DanyangSu sorry for the slow response, I somehow missed this issue.

I haven't run into this issue myself and am not entirely sure what is happening. Could you paste the the code you ran that produced it? And ideally attach the data csv too?

My one guess is that the date column might be getting parsed badly (pandas does this automagically, and sometimes gives wonky results). Can you verify that that ds column is of the format YYYY-MM-DD for daily data, or YYYY-MM-DD HH:MM:SS for timestamps?

DanyangSu commented 5 years ago

Hi,

I was able to fogure out the issue, I was passing ‘14’ as a string instead of a number. So I think an easy fix would be to check input type.

Danyang

On Thu, Dec 20, 2018 at 4:00 PM Ben Letham notifications@github.com wrote:

@DanyangSu https://github.com/DanyangSu sorry for the slow response, I somehow missed this issue.

I haven't run into this issue myself and am not entirely sure what is happening. Could you paste the the code you ran that produced it? And ideally attach the data csv too?

My one guess is that the date column might be getting parsed badly (pandas does this automagically, and sometimes gives wonky results). Can you verify that that ds column is of the format YYYY-MM-DD for daily data, or YYYY-MM-DD HH:MM:SS for timestamps?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/prophet/issues/750#issuecomment-449133858, or mute the thread https://github.com/notifications/unsubscribe-auth/Aes3TpDIrpMpGYvbc4AR796Kzz32meuBks5u6_p8gaJpZM4YwIyn .

bletham commented 5 years ago

Was this in the y column or ds? y is converted with pd.to_numeric so there shouldn't be an issue there. Unless it was in an extra regressor, in which case those were not being converted but that bug was recently fixed.

DanyangSu commented 5 years ago

It’s for ds. I was using docopt to parse days and I forgot to convert them before feeding them to fbprophet, so I ended up having option ds=‘30’ not ds=30, which caused the problem. But if you have already implement some guardrails, then that’s fine you can close this issue.

On Fri, Jan 4, 2019 at 6:12 PM Ben Letham notifications@github.com wrote:

Was this in the y column or ds? y is converted with pd.to_numeric so there shouldn't be an issue there. Unless it was in an extra regressor, in which case those were not being converted but that bug was recently fixed.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/prophet/issues/750#issuecomment-451596676, or mute the thread https://github.com/notifications/unsubscribe-auth/Aes3TlA3jwcLlkFm26rZk3IY4LXV_lFDks5u_9_MgaJpZM4YwIyn .