Skip to content

Instantly share code, notes, and snippets.

@cpard
Last active May 28, 2016 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cpard/3c784c754fba60579a393c7f7faa10ab to your computer and use it in GitHub Desktop.
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
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