Nettoyage
This commit is contained in:
parent
3823819dff
commit
15125ef6db
|
@ -27,32 +27,6 @@
|
|||
"import matplotlib.pyplot as plt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"id": "59ce5096-4e2c-45c1-be78-43e14db4142c",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# # modification des variables categorielles\n",
|
||||
" \n",
|
||||
"# ### variable gender\n",
|
||||
"# df1_customer_product[\"gender_label\"] = df1_customer_product[\"gender\"].map({\n",
|
||||
"# 0: 'female',\n",
|
||||
"# 1: 'male',\n",
|
||||
"# 2: 'other'\n",
|
||||
"# })\n",
|
||||
" \n",
|
||||
"# ### variable country -> on indique si le pays est france\n",
|
||||
"# df1_customer_product[\"country_fr\"] = df1_customer_product[\"country\"].apply(lambda x : int(x==\"fr\") if pd.notna(x) else np.nan)\n",
|
||||
"\n",
|
||||
"# # Création des indicatrices de gender\n",
|
||||
"# gender_dummies = pd.get_dummies(df1_customer_product[\"gender_label\"], prefix='gender').astype(int)\n",
|
||||
" \n",
|
||||
"# # Concaténation des indicatrices avec le dataframe d'origine\n",
|
||||
"# df1_customer_product = pd.concat([df1_customer_product, gender_dummies], axis=1)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
|
|
Loading…
Reference in New Issue
Block a user