Last active
May 28, 2016 22:06
-
-
Save cpard/3c784c754fba60579a393c7f7faa10ab to your computer and use it in GitHub Desktop.
Function to find if a recipient is mailing us from a business email or not
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
domains = ['gmail', 'yahoo', 'outlook'] | |
def isBusiness(st): | |
domain = st.split("@")[1] | |
res = True | |
for s in domains: | |
if s in domain: | |
res = False | |
break | |
return res | |
joinedEventsFrame = joinedEventsFrame.merge(joinedEventsFrame['email'].apply(isBusiness).to_frame(name='isBusiness'), left_index=True, right_index=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment