I need to assign "correct" to a new column"A" based on other column"B" condition , that is:- if column "B" has non blank entry then column "A" will assign value of "Correct" else "check required"
condition we have:
if column "B" contains any non blank entry then column "A" will assign with "correct"
input:-
Name B A
Adam 34
Screen
binny 35
tough
sunny 5
petter
output:- Name B A 0 Adam 34.0 Correct 1 Screen Correct 2 binny 35.0 Correct 3 tough Correct 4 sunny 5.0 Correct 5 petter Correct
I have tried the following:
df.loc[df['A'] != '', 'B'] = "Correct"
input enter image description here
output enter image description here