Cleaning special characters from text

PHOTO EMBED

Wed May 26 2021 04:07:55 GMT+0000 (UTC)

Saved by @Ariendal #python #pandas

def clean(txt):
    txt = txt.str.replace("(<br/>)", "")
    txt = txt.str.replace('(<a).*(>).*(</a>)', '')
    txt = txt.str.replace('(&amp)', '')
    txt = txt.str.replace('(&gt)', '')
    txt = txt.str.replace('(&lt)', '')
    txt = txt.str.replace('(\xa0)', ' ')  
    return txt
df['xxx column'] = clean(df['xxx column'])
content_copyCOPY