This is simple, but I'm not sure where I'm going wrong. Looking to create third column that has a value of 1 if the two other columns also equal 1.
Here's the code I'm using. Advice is appreciated - I'm clearly very new to python. Thanks in advance!
conditions = [
(db3['voted_2018'] == 1) & (db3['voted_2020'] == 1)]
db3['voted_both_elections'] = np.select(conditions, 1,0)