maxim5 / time-series-machine-learning

Machine learning models for time series analysis
Apache License 2.0
370 stars 103 forks source link

TypeError: dtype '<type 'datetime.datetime'>' not understood #11

Open renelikestacos opened 5 years ago

renelikestacos commented 5 years ago

Hi @maxim5 i tried to run your code,

fetching (run_fetch.py) the data worked but it failed afterwards at running the training (run_train.py) with the error

TypeError: dtype '<type 'datetime.datetime'>' not understood

Do you know about it? I tried to fix it in the to_changes function but I just drag another error with me. It seems that converting the date/time fields are not working anymore.

andrewpol777 commented 4 years ago

in module 'data_util.py' row 27:

'time': raw.date.astype(datetime.datetime).apply(lambda val: seconds(val) / (606024)),

'time': raw.date.astype('datetime64[ns]').apply(lambda val: seconds(val) / (60*60*24)),
maxim5 commented 4 years ago

Thanks @andrewpol777 you're right, this is more robust.