suppose I've a pandas dataframe with column values as age like this df.age = {25, 35, 76, 21, 23, 30}
I want to do an inplace replace like this:
if df.age >=25 and df.age <= 35: replace that value with 1 else: replace that value with 0
I've tried this df[df.age >= 7.35 and df.age <= 7.45, 'age'] = 0 but doesn't seem to work.