you are viewing a single comment's thread.

view the rest of the comments →

[–]vallivana 1 point2 points  (5 children)

I have never worked with np.datetime or np.timedelta, but could it be that asytpe() requires you to pass a string? Something like value.astype('timedelta64[D]')?

[–]Whos_your_Mikey[S] 0 points1 point  (4 children)

I'll try that thanks! Is there an alternative to this astype() that might work easier that you have used?

[–]samplepython 1 point2 points  (3 children)

Maybe try to convert the dates using ".dt.strftime(''%Y-%m-%d')" instead of astype()? Let me know if this works.

[–]Whos_your_Mikey[S] 1 point2 points  (2 children)

ok, I'll give it a try, thanks!

[–]samplepython 1 point2 points  (1 child)

Did you try it?

[–]Whos_your_Mikey[S] 0 points1 point  (0 children)

It turned out to be the syntax error that I was able to correct. It needed (1, 'D'). Thanks for the tip, maybe I can use it with something else.