I have the below dataframe
FQDN ip address verstatus Comments
0 pp.xx.com XX.XXX.XXX.XX Developed NaN
1 qq.xx.com XX.XXX.XXX.XX NaN NaN
2 gg.xx.com XX.XXX.XXX.XX Reserve NaN
3 gg.xx.com XX.XXX.XXX.XX Testing NaN
so I need to update then comments when the verstatus not equal "Developed" or "NaN"(else anything)
so expected result would be
FQDN ip address version status Comments
0 pp.xx.com XX.XXX.XXX.XX Developed NaN
1 qq.xx.com XX.XXX.XXX.XX NaN NaN
2 gg.xx.com XX.XXX.XXX.XX Reserve Reserve Status
3 gg.xx.com XX.XXX.XXX.XX Testing Testing Status
I tried
df['Comments'] = df.apply(lambda x: x["version status"]+" Status" if x['version status'] != 'Developed' or x['version status'].notna() else x['Comments'], axis=1)
But it not works properly