I want to update ColumnA if it have "0" and string "pandas" in ColumnC with the mean value [which i stored in columnB]
df['ColumnA'] = df.apply(lambda x: x['ColumnB'] if (x['ColumnA']==0 & x['ColumnC']=='pandas') else x['ColumnA'], axis=1)
I am getting this error
unsupported operand type(s) for &: 'int' and 'str'
kindly advise how i can fix it