df_subset looks like this:
day holiday date traffic_volume
0 Tuesday New Years Day 2013-01-01 1439
1 Tuesday None 2013-01-01 1502
2 Tuesday None 2013-01-01 933
3 Tuesday None 2013-01-01 576
4 Tuesday None 2013-01-01 372
... ... ... ... ...
8568 Tuesday None 2013-12-31 4504
8569 Tuesday None 2013-12-31 3478
8570 Tuesday None 2013-12-31 2711
8571 Tuesday None 2013-12-31 2189
8572 Tuesday None 2013-12-31 1457
[8573 rows x 8 columns]
I want to change the value in 'holiday' column to 'New Years Day' for those row which date is 2013-01-01, and run these codes BUT does not update:
from datetime import *
NYD=date(2013,1,1)
if df_subset.date is NYD:
df_subset.replace('None','New Years Day')
Or are there better way to check date and update a cell in the dataframe?