There are two column A and column Aging. Required to create a new column called simulator with condition (mean+std) of column A. For example for all Aging==2, simulator should be calculated basis the corresponding values in column A .
I tried the the given below code however when i change the Aging value, the simulator value does not change. Provided below is the reference data and the code i tried.
# seed the pseudorandom number generator
from numpy.random import seed
from numpy.random import randint
# seed random number generator
seed(1)
# generate some random numbers
x=pd.DataFrame(randint(0, 10, 20),columns=list('A'))
# reset the seed
seed(1)
# generate some random numbers
x['aging']=pd.DataFrame(randint(1,5,20),columns=list('z'))
x['simulator']=np.where(x['aging']==2,x.A.mean()+x.A.std(),0)
x['simulator']=np.where(x['aging']==4,x.A.mean()+x.A.std(),x['simulator'])