I currently have a list and 1 table with 2 col names
list = [a,b,c]
TableA has colA and colB.
I want to set the value in colB depending on my value in colA.
if list is in col A, set col B to 1. Else, set col B to 0.
I've tried this loop but it's inefficient due to my large dataset.
for i in TableA['colA']:
if '' in i :
TableA['colB'] = '0'
elif 'list value 1' in i:
TableA['colB'] = '0'
elif 'list value 2' in i:
TableA['colB'] = '0'
elif 'list value 3' in i:
TableA['colB'] = '0'
else:
TableA['colB'] = '1'
Please help with something more efficient.