I have 2 columns with dates in them, i want to create a 3rd column with the max of these 2 dates:
df['xxx_MaxSettDate'][0]
Out[186]: Timestamp('2017-01-20 00:00:00')
df['yyy_MaxSettDate'][0]
Out[166]: NaT
here is my max function:
df['MaxSettDate']=df[['xxx_MaxSettDate','yyy_MaxSettDate']].max(axis=1)
output:
df['MaxSettDate'][0]
Out[187]: 1.4848704e+18
I want to be able to do operation on this date, such as remove all dates which are lower than 1m
so I do this:
onemonthdate = date.today() + timedelta(30)
df = df[(df['MaxSettDate']>onemonthdate)]
This results in the error:
TypeError: unorderable types: float() > datetime.date()
Thoughts on how I could achieve this pls? I am geting very confused over all the solutions provided.. you could also just point me to something which I could read and understand the whole dates paradigm in python better.. thanks vm!