<jupyter_start><jupyter_text>Criando Faixas de Valor<jupyter_code>import pandas as pd # noqa E402
dados = pd.read_csv('../../data/extras/aluguel.csv', sep=';')
dados.head(10)
# 1 e 2
# 3 e 4
# 5 e 6
# 7 ou mais

classes = [0, 2, 4, 6, 100]
quartos = pd.cut(dados['Quartos'], classes)
quartos
pd.value_counts(quartos)
labels = [
    "1 e 2 quartos",
    "3 e 4 quartos",
    "5 e 6 quartos",
    "7 quartos ou mais",
]
quartos = pd.cut(dados['Quartos'], classes, labels=labels)
quartos
pd.value_counts(quartos)
quartos = pd.cut(dados["Quartos"], classes, labels=labels, include_lowest=True)
quartos
pd.value_counts(quartos)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15644171779141106, 'fraction_numerical': 0.03987730061349693, 'mean_word_length': 4.778761061946903, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '144871', 'license': 'MIT', 'n_tokens_mistral': 302, 'n_tokens_neox': 271, 'n_words': 66, 'path': 'notebook/extras/aula-08-06-criando-faixas-de-valor.ipynb', 'repo_name': 'josenaldo/alura-ds-python-pandas-tratando-e-analisando-dados', 'size': '652'}