Checking whether customers in a dataframe have social media accounts
Few things to note here:

Columns:

email_results=['facebook','foursquare','instagram']
phone_results=['facebook','linkedin','twitter']


Conditions:

c1=df.phone.isna()&amp;df.email.notna()
c2=df.phone.notna()&amp;df.email.isna()


Method1

You can try and replace if else conditions with np.where , also take a look at np.select() if you have elif conditions:

df[email_results]=np.where(c1[:,None],'Found Social Media',df[email_results])
df[phone_results]=np.where(c2[:,None],'Found Social Media',df[phone_results])
print(df)


Method2

Or you can take a look at df.mask():

df[email_results]=df[email_results].mask(c1,'Found Social Media')
df[phone_results]=df[phone_results].mask(c2,'Found Social Media')
print(df)