I have a pandas dataframe with a row that contains data such as:
1 year
1 month
1 week
4 year
3 week
etc etc
I am trying to replace anything that contains "month" or "week" to 0
train_df.age["weeks" in train_df.age] = 0
and
for i in train_df['age']:
if "weeks" in i:
i = "0"
None of which seem to work.
Any advice on how to do this? Thanks.