In [5]: d.loc[(d['A'].isnull()) & (d.B == 't3'), 'A']='new_val' d Out[5]: A B 0 NaN t1 1 t2 t2 2 new_val t3 3 t3 t4 4 new_val t3 [5 rows x 2 columns]
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter