Enlever drop pour description segmentation

This commit is contained in:
Antoine JOUBREL 2024-03-26 10:48:50 +00:00
parent a32cbe70e4
commit c620f23507

View File

@ -113,20 +113,20 @@ def customerplus_kpi_function(customerplus_clean = None):
customerplus_clean['categorie_age_70_80'] = ((customerplus_clean['age'] >= 70) & (customerplus_clean['age'] < 80)).astype(int)
customerplus_clean['categorie_age_plus_80'] = (customerplus_clean['age'] >= 80).astype(int)
customerplus_clean['categorie_age_inconnue'] = customerplus_clean['age'].apply(lambda x: 1 if pd.isna(x) else 0)
customerplus_clean.drop(columns = "age", inplace = True)
# customerplus_clean.drop(columns = "age", inplace = True)
# Consentement au mailing
customerplus_clean['opt_in'] = customerplus_clean['opt_in'].astype(int)
# Indicatrice si individue vit en France
customerplus_clean["country_fr"] = customerplus_clean["country"].apply(lambda x : int(x=="fr") if pd.notna(x) else np.nan)
customerplus_clean.drop(columns = "country", inplace = True)
# customerplus_clean.drop(columns = "country", inplace = True)
customerplus_clean['is_profession_known'] = customerplus_clean['profession'].notna().astype(int)
customerplus_clean.drop(columns = "profession", inplace = True)
# customerplus_clean.drop(columns = "profession", inplace = True)
customerplus_clean['is_zipcode_known'] = customerplus_clean['zipcode'].notna().astype(int)
customerplus_clean.drop(columns = "zipcode", inplace = True)
# customerplus_clean.drop(columns = "zipcode", inplace = True)
return customerplus_clean