texthero.preprocessing.remove_whitespace¶
-
remove_whitespace
(input: pandas.core.series.Series) → pandas.core.series.Series¶ Remove any extra white spaces.
Remove any extra whitespace in the given Pandas Series. Removes also newline, tabs and any form of space.
Useful when there is a need to visualize a Pandas Series and most cells have many newlines or other kind of space characters.
Examples
>>> import texthero as hero >>> import pandas as pd >>> s = pd.Series("Title \n Subtitle \t ...") >>> hero.remove_whitespace(s) 0 Title Subtitle ... dtype: object