texthero.preprocessing.remove_punctuation¶
-
remove_punctuation
(input: pandas.core.series.Series) → pandas.core.series.Series¶ Replace all punctuation with a single space (” “).
remove_punctuation removes all punctuation from the given Pandas Series and replace it with a single space. It consider as punctuation characters all
string.punctuation
symbols !”#$%&’()*+,-./:;<=>?@[]^_`{|}~).See also
replace_punctuation()
to replace punctuation with a custom symbol.Examples
>>> import texthero as hero >>> import pandas as pd >>> s = pd.Series("Finnaly.") >>> hero.remove_punctuation(s) 0 Finnaly dtype: object