Podrías simplemente usar el tipo [`Categorical`][1] para tus columnas. PAra segmentar por los intervalos deseados puedes usar [`pandas.cut`][2]: import io import numpy as np import pandas as pd data = io.StringIO(""" A B C D E 3.75 3.50 4.00 4.75 3.00 3.45 5.25 3.75 5.50 2.00 3.25 4.00 3.75 4.00 5.50 2.75 4.00 4.00 4.00 2.75 """) df = pd.read_csv(data, sep="\s+") > >>> df > A B C D E > 0 3.75 3.50 4.00 4.75 3.00 > 1 3.45 5.25 3.75 5.50 2.00 > 2 3.25 4.00 3.75 4.00 5.50 > 3 2.75 4.00 4.00 4.00 2.75 df = pd.cut(df.stack(), (-np.inf, 2.99, 5, np.inf), labels=('neg', 'neut', 'pos') ).unstack() > > >>> df > > A B C D E > 0 neut neut neut neut neut > 1 neut pos neut pos neg > 2 neut neut neut neut pos > 3 neg neut neut neut neg --- Edición --- Si solo se quiere pasar a categóricas ciertas columnas del DataFrame basta con usar `loc` para seleccionar las deseadas y reasignarles el nuevo valor: import pandas as pd import io import numpy as np data = io.StringIO(""" A B C D E 3.75 3.50 4.00 4.75 3.00 3.45 5.25 3.75 5.50 2.00 3.25 4.00 3.75 4.00 5.50 2.75 4.00 4.00 4.00 2.75 """) import pandas as pd df = pd.read_csv(data, sep="\s+") df.loc[:, ['A', 'C', 'D']] = pd.cut(df.loc[:, ['A', 'C', 'D']].stack(), (-np.inf, 2.99, 5, np.inf), labels=('neg', 'neut', 'pos') ).unstack() > >>> df > > A B C D E > 0 neut 3.50 neut neut 3.00 > 1 neut 5.25 neut pos 2.00 > 2 neut 4.00 neut neut 5.50 > 3 neg 4.00 neut neut 2.75 [1]: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.CategoricalDtype.html#pandas.CategoricalDtype [2]: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.cut.html