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 [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