redact_emails_1.py 364 B

12345678910
  1. def email(df):
  2. return pd.Series(df.apply(lambda text: re.sub("\S+@\S+", r'xxx', text)))
  3. # #################################### Test
  4. # #########################################
  5. #
  6. # Texts = ["I used these two email mouafek.ayadi@esprit.tn, moufak.ayadi@oddo-bhf.com", "this is another email afek.aadi@esit.com" ]
  7. # data = pd.Series(Texts)
  8. # print(email(data))