У меня есть 2 столбца даты и времени панды, и я хочу сравнить их следующим образом:
#check if the Date_Jan precedes Date_Feb
df['find_preceding'] = df.apply(lambda x: x.Date_Jan < x.Date_Feb, axis =1) # works
# check if the Date_Jan follows Date_Feb
df['find_following'] = df.apply(lambda x: x.Date_Jan > x.Date_Feb, axis =1) # works
# check if Date_Jan and Date_Feb are the same
df['find_same'] = df.apply(lambda x: x.Date_Jan == x.Date_Feb, axis =1) # works
# check if Date_Jan is NaT and Date_Feb is a date
df['check_NaT_and_valid'] = df.apply(lambda x: x.Date_Jan == 'NaT' and x.Date_Feb != 'NaT', axis =1) # NOT working