I have the date :
dateTo=pd.to_datetime('today').strftime('%Y-%m-%d')
And I would like to subtract dateTo
to the column of dates:
number dates coord
AC 10 2018-07-10 11.54
AC 10 2018-07-11 11.19
AN 5 2018-07-12 69.40
The desired output would be a new column df['datepond']
with the output of the subtraction. I would like this output to be integers.
What I tried was a response given here Pandas: Subtracting two date columns and the result being an integer:
df['datepond']=(pd.Timestamp(dateTo)-pd.to_datetime(df['dates']))/ np.timedelta64(1, 'D')
In version numpy 1.12.1 it worked pretty good but im now at numpy 1.15.2 and it outputs
TypeError: data type "datetime" not understood
How could I obtain the desired output?