Trying to perform rfm on my database. In order to calculate number of days using below code -
Code:
sd = dt.date(2019, 8, 1)
data['hist']=sd - data['transaction_created']
data['hist'].astype('timedelta64[D]')
data['hist']=data['hist'] / np.timedelta64(1, 'D')
data.head()
Have converted my dates into date form while importing data to python using below SQL query -
to_char (r.created_at, 'yyyy-mm-dd')...