def clean(txt): txt = txt.str.replace("(<br/>)", "") txt = txt.str.replace('(<a).*(>).*(</a>)', '') txt = txt.str.replace('(&)', '') txt = txt.str.replace('(>)', '') txt = txt.str.replace('(<)', '') txt = txt.str.replace('(\xa0)', ' ') return txt df['xxx column'] = clean(df['xxx column'])
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter