I have the following dataframe:
>>> name age grade pass
0 Dana 23 95 yes
1 Emaa 24 yes
2 Don 25 99 yes
3 Daniela 24 85 yes
4 Fred 21 yes
I want to create a condition so if column grade is null, the value in column pass will be no :
>>> name age grade pass
0 Dana 23 95 yes
1 Emaa 24 no
2 Don 25 99 yes
3 Daniela 24 85 yes
4 Fred 21 no
I have tried this way:
if df['grade'].isna():
df['pass']='no'
but I get error:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
how can I get the expected results? what am I doing wrong?