Boa noite,
Ao executar o codigo abaixo, não gera saída e apresenta um erro.
classes = [0, 1570, 3152, 7880, 15760]
labels = ['E','D','C','B','A']
pd.cut(x = dados.Renda,
bins = bins,
labels = labels,
include_lowest = True)
Erro:
ValueError Traceback (most recent call last)
<ipython-input-126-efabd1197d89> in <module>()
1 pd.cut(x = dados.Renda,
2 bins = bins,
----> 3 labels = labels)
445 if len(labels) != len(bins) - 1:
446 raise ValueError(
--> 447 "Bin labels must be one fewer than the number of bin edges"
448 )
449 if not is_categorical_dtype(labels):
ValueError: Bin labels must be one fewer than the number of bin edges