Pandas: select all dates with specific month and day

Pandas Series with datetime now behaves differently. See .dt accessor.

This is how it should be done now:

df.loc[(df['date'].dt.day==25) & (cust_df['date'].dt.month==12), 'xmas'] = 1

Leave a Comment