From what I understand this should just pass by the if statement if there is no email column present but it's throwing KeyError: None
when it gets to the if statement. Could someone help me understand this rule? Thanks!
def not_isin(df1, df2, phone_col, df2phone_col,website_col, df2website_col,company_col, df2company_col, email_col, df2email_col):
print("entered not_isin")
df1 = df1[~df1[phone_col].isin(df2[df2phone_col])]
df1 = df1[~df1[website_col].isin(df2[df2website_col])]
df1 = df1[~df1[company_col].isin(df2[df2company_col])]
if df1[email_col] and df2[df2email_col]:
df1 = df1[~df1[email_col].isin(df2[df2email_col])]
return df1
return df1