<jupyter_start><jupyter_text>Desafio Cartão de credito Porque os clientes estão desistindo da compra- Passo 1: Importar base de dados de https://www.kaggle.com/sakshigoyal7/credit-card-customers- Passo 2: Tratar base de dados- Passo 3: Visualizar dados- Passo 4: Construir uma analise com as soluções para isso  Passo 1 :<jupyter_code>import pandas as pd
import matplotlib.pyplot as plt
db = pd.read_csv(r'C:\Users\vinis\Downloads\archive\BankChurners.csv')
print(db.head())
print(db.info())
print(db.describe())
print(db.shape)<jupyter_output>(10127, 23)<jupyter_text>Passo 2:<jupyter_code>db = db.drop(columns=['CLIENTNUM'])

print(db.head())
print(db.describe().round(2))
display(db.info())
qte = db['Attrition_Flag'].value_counts()
qte_perc  =db['Attrition_Flag'].value_counts(normalize=True)
print(f"""Valores totais:
{qte}

Valores percentuais:
{qte_perc}""")<jupyter_output>Valores totais:
Existing Customer    8500
Attrited Customer    1627
Name: Attrition_Flag, dtype: int64

Valores percentuais:
Existing Customer    0.83934
Attrited Customer    0.16066
Name: Attrition_Flag, dtype: float64<jupyter_text>Passo 3:<jupyter_code>for coluna in db:
    if coluna != 'Attrition_Flag':
        I_cliente = db[coluna].loc[db['Attrition_Flag'] =='Existing Customer' ]
        I_des = db[coluna].loc[db['Attrition_Flag'] !='Existing Customer' ]
        plt.hist(I_cliente, color='skyblue', label='Clientes')
        plt.hist(I_des, label='Desistentes')
        plt.xlabel(coluna)
        plt.legend()
        plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1329890251775339, 'fraction_numerical': 0.025823111684958037, 'mean_word_length': 5.404958677685951, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '375642', 'license': 'MIT', 'n_tokens_mistral': 615, 'n_tokens_neox': 587, 'n_words': 117, 'path': 'Data_analysis/Test1_Minicurso#.ipynb', 'repo_name': 'ViniciusRCortez/Machine_learning', 'size': '1549'}