Exclude a specific date based on a condition using pandas
问题 df2 = pd.DataFrame({'person_id':[11,11,11,11,11,12,12,13,13,14,14,14,14], 'admit_date':['01/01/2011','01/01/2009','12/31/2013','12/31/2017','04/03/2014','08/04/2016', '03/05/2014','02/07/2011','08/08/2016','12/31/2017','05/01/2011','05/21/2014','07/12/2016']}) df2 = df2.melt('person_id', value_name='dates') df2['dates'] = pd.to_datetime(df2['dates']) What I would like to do is a) Exclude/filter out records from the data frame if a subject has Dec 31st and Jan 1st in its records. Please note