mapper = lambda x: x.strftime('%Y-%m-%d') if isinstance(x, datetime.datetime
    ) else x
Trying to convert column headings which are in datetime.datetime format 2016-09-01 00:00:00 to datetime.datetime format to '2016-09-01'