'regarding python pandas-date comparison

I have six columns in a dataframe: 1.vins 2.mileage 3.complaints_flag 4.ro_opened_date 5.complained_date 6.date_flag

i want to flag the date_flag as yes or no for every vin where the ro_opened_date is nearest to the complained_date and take out that mileage for that particular vin. how to do it in python pandas.?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source