Pandas - Add Value To A Column On A For
Im trying a script and i want to add value to each row on my Column login: If the result on For is 200 i want add 'yes' to the login Column on the correct row. thank u! import pand
Solution 1:
You might do it in one single line using apply
:
newdf['login'] = newdf['Site'].apply(lambda x : "yes"ifget(x).status_code == 200else"no")
Post a Comment for "Pandas - Add Value To A Column On A For"