Apply BeautifulSoup function to Pandas DataFrame
问题 I have a Pandas DataFrame that I got from reading a csv, in that file there is HTML tags I want to remove. I want to remove the tags with BeautifulSoup because it is more reliable than using a simple regex like <.*?>. I usually remove HTML tags from Strings by executing text = BeautifulSoup(text, 'html.parser').get_text() Now I want to do this with every element in my DataFrame, so I tried the following: df.apply(lambda text: BeautifulSoup(text, 'html.parser').get_text()) But that returns the