I have a dataframe df
, with two columns, GROUP_ID={A,B}
and ACTION_DATE
. What I want to do is to replace the ACTION_DATE
value to 03/31/2006
, if the GROUP_ID
's value is B
. Data type of ACTION_DATE
is datetime64[ns]
.
So, I tried the following.
df[(df.GROUP_ID == 'B')].ACTION_DATE = '03/31/2006 0:00'
The above line runs with no errors, but the resulting dataframe remains unchanged.
Could someone point out what I am missing?