Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. import re
  2.  
  3. pattern = "([A-Z0-9._%+-]+)@([A-Z0-9.-]+)"
  4.  
  5. # Inserting colum headers, applied after extract
  6. pattern = "(?P<email>[A-Z0-9._%+-]+)@(?P<domain>[A-Z0-9.-]+)"
  7.  
  8. # Generates two columns
  9. email_components = df["email"].str.extract(pattern, flags=re.IGNORECASE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement