I have a data frame with a field named 'completed_date' and it has a bunch of dates that look like this: '1900-01-01'
. How can I update all these dates to be '2019-01-01'
only if the date is '1900-01-01'
?
I tried this code.
df.loc[df['completed_date'] == '1900-01-01', 'completed_date'] = '2019-01-01'
I didn't get an error and it seemed to run fine, but when I look at the results, I still see a bunch of '1900-01-01'
records in this field. Maybe there is a Pandas solution for this. Not sure. Any thoughts?