Ajout KPI Alexis dans fonction
This commit is contained in:
parent
63d11bbae8
commit
7154a1c82c
|
@ -1702,7 +1702,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 34,
|
||||
"execution_count": 69,
|
||||
"id": "043303fe-e90f-4689-a2a9-5d690555a045",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
|
@ -1719,6 +1719,12 @@
|
|||
" prop_vente_internet = tickets_information_copy[tickets_information_copy['vente_internet'] == 1].groupby(['customer_id', 'event_type_id'])['ticket_id'].count().reset_index()\n",
|
||||
" prop_vente_internet.rename(columns = {'ticket_id' : 'nb_tickets_internet'}, inplace = True)\n",
|
||||
"\n",
|
||||
" # Average amount\n",
|
||||
" avg_amount = (tickets_information_copy.groupby([\"event_type_id\", 'name_event_types'])\n",
|
||||
" .agg({\"amount\" : \"mean\"}).reset_index()\n",
|
||||
" .rename(columns = {'amount' : 'avg_amount'}))\n",
|
||||
"\n",
|
||||
" \n",
|
||||
" tickets_kpi = (tickets_information_copy[['event_type_id', 'customer_id', 'purchase_id' ,'ticket_id','supplier_name', 'purchase_date', 'amount', 'vente_internet']]\n",
|
||||
" .groupby(['customer_id', 'event_type_id']) \n",
|
||||
" .agg({'ticket_id': 'count', \n",
|
||||
|
@ -1751,7 +1757,7 @@
|
|||
" tickets_kpi = tickets_kpi.merge(prop_vente_internet, on = ['customer_id', 'event_type_id'], how = 'left')\n",
|
||||
" tickets_kpi['nb_tickets_internet'] = tickets_kpi['nb_tickets_internet'].fillna(0)\n",
|
||||
"\n",
|
||||
" \n",
|
||||
" tickets_kpi = tickets_kpi.merge(avg_amount, how='left', on= 'event_type_id')\n",
|
||||
"\n",
|
||||
" return tickets_kpi\n",
|
||||
" "
|
||||
|
@ -1759,7 +1765,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 35,
|
||||
"execution_count": 70,
|
||||
"id": "5882234a-1ed5-4269-87a6-0d75613476e3",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
|
@ -1938,800 +1944,6 @@
|
|||
"## Alexis' work"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 39,
|
||||
"id": "273857e0-7112-4294-8ba6-3c39c5cbc13a",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div>\n",
|
||||
"<style scoped>\n",
|
||||
" .dataframe tbody tr th:only-of-type {\n",
|
||||
" vertical-align: middle;\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .dataframe tbody tr th {\n",
|
||||
" vertical-align: top;\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .dataframe thead th {\n",
|
||||
" text-align: right;\n",
|
||||
" }\n",
|
||||
"</style>\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>customer_id</th>\n",
|
||||
" <th>event_type_id</th>\n",
|
||||
" <th>nb_tickets</th>\n",
|
||||
" <th>nb_purchases</th>\n",
|
||||
" <th>total_amount</th>\n",
|
||||
" <th>nb_suppliers</th>\n",
|
||||
" <th>vente_internet_max</th>\n",
|
||||
" <th>purchase_date_min</th>\n",
|
||||
" <th>purchase_date_max</th>\n",
|
||||
" <th>time_between_purchase</th>\n",
|
||||
" <th>nb_tickets_internet</th>\n",
|
||||
" </tr>\n",
|
||||
" </thead>\n",
|
||||
" <tbody>\n",
|
||||
" <tr>\n",
|
||||
" <th>0</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>384226</td>\n",
|
||||
" <td>194790</td>\n",
|
||||
" <td>2686540.5</td>\n",
|
||||
" <td>7</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>3262.190868</td>\n",
|
||||
" <td>4.179306</td>\n",
|
||||
" <td>3258.011562</td>\n",
|
||||
" <td>51.0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>4</td>\n",
|
||||
" <td>453242</td>\n",
|
||||
" <td>228945</td>\n",
|
||||
" <td>3248965.5</td>\n",
|
||||
" <td>6</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>3698.198229</td>\n",
|
||||
" <td>5.221840</td>\n",
|
||||
" <td>3692.976389</td>\n",
|
||||
" <td>2988.0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>2</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>201750</td>\n",
|
||||
" <td>107110</td>\n",
|
||||
" <td>1459190.0</td>\n",
|
||||
" <td>6</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>3803.369792</td>\n",
|
||||
" <td>0.146331</td>\n",
|
||||
" <td>3803.223461</td>\n",
|
||||
" <td>9.0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>3</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>6</td>\n",
|
||||
" <td>217356</td>\n",
|
||||
" <td>111786</td>\n",
|
||||
" <td>1435871.5</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2502.715509</td>\n",
|
||||
" <td>1408.715532</td>\n",
|
||||
" <td>1093.999977</td>\n",
|
||||
" <td>5.0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>4</th>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>143</td>\n",
|
||||
" <td>143</td>\n",
|
||||
" <td>0.0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2041.274549</td>\n",
|
||||
" <td>1340.308160</td>\n",
|
||||
" <td>700.966389</td>\n",
|
||||
" <td>0.0</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" customer_id event_type_id nb_tickets nb_purchases total_amount \\\n",
|
||||
"0 1 2 384226 194790 2686540.5 \n",
|
||||
"1 1 4 453242 228945 3248965.5 \n",
|
||||
"2 1 5 201750 107110 1459190.0 \n",
|
||||
"3 1 6 217356 111786 1435871.5 \n",
|
||||
"4 2 2 143 143 0.0 \n",
|
||||
"\n",
|
||||
" nb_suppliers vente_internet_max purchase_date_min purchase_date_max \\\n",
|
||||
"0 7 1 3262.190868 4.179306 \n",
|
||||
"1 6 1 3698.198229 5.221840 \n",
|
||||
"2 6 1 3803.369792 0.146331 \n",
|
||||
"3 5 1 2502.715509 1408.715532 \n",
|
||||
"4 1 0 2041.274549 1340.308160 \n",
|
||||
"\n",
|
||||
" time_between_purchase nb_tickets_internet \n",
|
||||
"0 3258.011562 51.0 \n",
|
||||
"1 3692.976389 2988.0 \n",
|
||||
"2 3803.223461 9.0 \n",
|
||||
"3 1093.999977 5.0 \n",
|
||||
"4 700.966389 0.0 "
|
||||
]
|
||||
},
|
||||
"execution_count": 39,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"df1_tickets_kpi.head()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 40,
|
||||
"id": "449731f3-340f-4648-8210-4622c7dbc174",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div>\n",
|
||||
"<style scoped>\n",
|
||||
" .dataframe tbody tr th:only-of-type {\n",
|
||||
" vertical-align: middle;\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .dataframe tbody tr th {\n",
|
||||
" vertical-align: top;\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .dataframe thead th {\n",
|
||||
" text-align: right;\n",
|
||||
" }\n",
|
||||
"</style>\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>event_type_id</th>\n",
|
||||
" <th>name_event_types</th>\n",
|
||||
" <th>avg_amount</th>\n",
|
||||
" </tr>\n",
|
||||
" </thead>\n",
|
||||
" <tbody>\n",
|
||||
" <tr>\n",
|
||||
" <th>0</th>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>offre muséale individuel</td>\n",
|
||||
" <td>6.150659</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>4</td>\n",
|
||||
" <td>spectacle vivant</td>\n",
|
||||
" <td>7.762474</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>2</th>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>offre muséale groupe</td>\n",
|
||||
" <td>4.452618</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>3</th>\n",
|
||||
" <td>6</td>\n",
|
||||
" <td>formule adhésion</td>\n",
|
||||
" <td>6.439463</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" event_type_id name_event_types avg_amount\n",
|
||||
"0 2 offre muséale individuel 6.150659\n",
|
||||
"1 4 spectacle vivant 7.762474\n",
|
||||
"2 5 offre muséale groupe 4.452618\n",
|
||||
"3 6 formule adhésion 6.439463"
|
||||
]
|
||||
},
|
||||
"execution_count": 40,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"avg_amount = (df1_products_purchased_reduced.groupby([\"event_type_id\", 'name_event_types'])\n",
|
||||
" .agg({\"amount\" : \"mean\"}).reset_index()\n",
|
||||
" .rename(columns = {'amount' : 'avg_amount'}))\n",
|
||||
"\n",
|
||||
"avg_amount"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 41,
|
||||
"id": "b54bd9e8-3cad-453b-8e58-bf6d047912eb",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div>\n",
|
||||
"<style scoped>\n",
|
||||
" .dataframe tbody tr th:only-of-type {\n",
|
||||
" vertical-align: middle;\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .dataframe tbody tr th {\n",
|
||||
" vertical-align: top;\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .dataframe thead th {\n",
|
||||
" text-align: right;\n",
|
||||
" }\n",
|
||||
"</style>\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>customer_id</th>\n",
|
||||
" <th>event_type_id</th>\n",
|
||||
" <th>nb_tickets</th>\n",
|
||||
" <th>nb_purchases</th>\n",
|
||||
" <th>total_amount</th>\n",
|
||||
" <th>nb_suppliers</th>\n",
|
||||
" <th>vente_internet_max</th>\n",
|
||||
" <th>purchase_date_min</th>\n",
|
||||
" <th>purchase_date_max</th>\n",
|
||||
" <th>time_between_purchase</th>\n",
|
||||
" <th>nb_tickets_internet</th>\n",
|
||||
" <th>name_event_types</th>\n",
|
||||
" <th>avg_amount</th>\n",
|
||||
" </tr>\n",
|
||||
" </thead>\n",
|
||||
" <tbody>\n",
|
||||
" <tr>\n",
|
||||
" <th>0</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>384226</td>\n",
|
||||
" <td>194790</td>\n",
|
||||
" <td>2686540.5</td>\n",
|
||||
" <td>7</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>3262.190868</td>\n",
|
||||
" <td>4.179306</td>\n",
|
||||
" <td>3258.011562</td>\n",
|
||||
" <td>51.0</td>\n",
|
||||
" <td>offre muséale individuel</td>\n",
|
||||
" <td>6.150659</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>4</td>\n",
|
||||
" <td>453242</td>\n",
|
||||
" <td>228945</td>\n",
|
||||
" <td>3248965.5</td>\n",
|
||||
" <td>6</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>3698.198229</td>\n",
|
||||
" <td>5.221840</td>\n",
|
||||
" <td>3692.976389</td>\n",
|
||||
" <td>2988.0</td>\n",
|
||||
" <td>spectacle vivant</td>\n",
|
||||
" <td>7.762474</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>2</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>201750</td>\n",
|
||||
" <td>107110</td>\n",
|
||||
" <td>1459190.0</td>\n",
|
||||
" <td>6</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>3803.369792</td>\n",
|
||||
" <td>0.146331</td>\n",
|
||||
" <td>3803.223461</td>\n",
|
||||
" <td>9.0</td>\n",
|
||||
" <td>offre muséale groupe</td>\n",
|
||||
" <td>4.452618</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>3</th>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>6</td>\n",
|
||||
" <td>217356</td>\n",
|
||||
" <td>111786</td>\n",
|
||||
" <td>1435871.5</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2502.715509</td>\n",
|
||||
" <td>1408.715532</td>\n",
|
||||
" <td>1093.999977</td>\n",
|
||||
" <td>5.0</td>\n",
|
||||
" <td>formule adhésion</td>\n",
|
||||
" <td>6.439463</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>4</th>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>143</td>\n",
|
||||
" <td>143</td>\n",
|
||||
" <td>0.0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2041.274549</td>\n",
|
||||
" <td>1340.308160</td>\n",
|
||||
" <td>700.966389</td>\n",
|
||||
" <td>0.0</td>\n",
|
||||
" <td>offre muséale individuel</td>\n",
|
||||
" <td>6.150659</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" customer_id event_type_id nb_tickets nb_purchases total_amount \\\n",
|
||||
"0 1 2 384226 194790 2686540.5 \n",
|
||||
"1 1 4 453242 228945 3248965.5 \n",
|
||||
"2 1 5 201750 107110 1459190.0 \n",
|
||||
"3 1 6 217356 111786 1435871.5 \n",
|
||||
"4 2 2 143 143 0.0 \n",
|
||||
"\n",
|
||||
" nb_suppliers vente_internet_max purchase_date_min purchase_date_max \\\n",
|
||||
"0 7 1 3262.190868 4.179306 \n",
|
||||
"1 6 1 3698.198229 5.221840 \n",
|
||||
"2 6 1 3803.369792 0.146331 \n",
|
||||
"3 5 1 2502.715509 1408.715532 \n",
|
||||
"4 1 0 2041.274549 1340.308160 \n",
|
||||
"\n",
|
||||
" time_between_purchase nb_tickets_internet name_event_types \\\n",
|
||||
"0 3258.011562 51.0 offre muséale individuel \n",
|
||||
"1 3692.976389 2988.0 spectacle vivant \n",
|
||||
"2 3803.223461 9.0 offre muséale groupe \n",
|
||||
"3 1093.999977 5.0 formule adhésion \n",
|
||||
"4 700.966389 0.0 offre muséale individuel \n",
|
||||
"\n",
|
||||
" avg_amount \n",
|
||||
"0 6.150659 \n",
|
||||
"1 7.762474 \n",
|
||||
"2 4.452618 \n",
|
||||
"3 6.439463 \n",
|
||||
"4 6.150659 "
|
||||
]
|
||||
},
|
||||
"execution_count": 41,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"df1_tickets_kpi = df1_tickets_kpi.merge(avg_amount, how='left', on= 'event_type_id')\n",
|
||||
"df1_tickets_kpi.head()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 42,
|
||||
"id": "2d6afe74-2517-478b-a99c-da9c7bd2edd4",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div>\n",
|
||||
"<style scoped>\n",
|
||||
" .dataframe tbody tr th:only-of-type {\n",
|
||||
" vertical-align: middle;\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .dataframe tbody tr th {\n",
|
||||
" vertical-align: top;\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .dataframe thead th {\n",
|
||||
" text-align: right;\n",
|
||||
" }\n",
|
||||
"</style>\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>customer_id</th>\n",
|
||||
" <th>birthdate</th>\n",
|
||||
" <th>street_id</th>\n",
|
||||
" <th>is_partner</th>\n",
|
||||
" <th>gender</th>\n",
|
||||
" <th>is_email_true</th>\n",
|
||||
" <th>opt_in</th>\n",
|
||||
" <th>structure_id</th>\n",
|
||||
" <th>profession</th>\n",
|
||||
" <th>language</th>\n",
|
||||
" <th>...</th>\n",
|
||||
" <th>fidelity</th>\n",
|
||||
" <th>average_purchase_delay</th>\n",
|
||||
" <th>average_price_basket</th>\n",
|
||||
" <th>average_ticket_basket</th>\n",
|
||||
" <th>total_price</th>\n",
|
||||
" <th>purchase_count</th>\n",
|
||||
" <th>first_buying_date</th>\n",
|
||||
" <th>country</th>\n",
|
||||
" <th>age</th>\n",
|
||||
" <th>tenant_id</th>\n",
|
||||
" </tr>\n",
|
||||
" </thead>\n",
|
||||
" <tbody>\n",
|
||||
" <tr>\n",
|
||||
" <th>0</th>\n",
|
||||
" <td>12751</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>True</td>\n",
|
||||
" <td>True</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaT</td>\n",
|
||||
" <td>fr</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>1311</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>12825</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>True</td>\n",
|
||||
" <td>True</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaT</td>\n",
|
||||
" <td>fr</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>1311</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>2</th>\n",
|
||||
" <td>11261</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>True</td>\n",
|
||||
" <td>True</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaT</td>\n",
|
||||
" <td>fr</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>1311</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>3</th>\n",
|
||||
" <td>13071</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>True</td>\n",
|
||||
" <td>True</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaT</td>\n",
|
||||
" <td>fr</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>1311</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>4</th>\n",
|
||||
" <td>653061</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>10</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>True</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaT</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>1311</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>...</th>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>151861</th>\n",
|
||||
" <td>295252</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>10</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>True</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaT</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>1311</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>151862</th>\n",
|
||||
" <td>295271</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>10</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>True</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaT</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>1311</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>151863</th>\n",
|
||||
" <td>295275</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>10</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>True</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>NaT</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>1311</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>151864</th>\n",
|
||||
" <td>295366</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>True</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>3.0</td>\n",
|
||||
" <td>33.0</td>\n",
|
||||
" <td>3.0</td>\n",
|
||||
" <td>33.0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2021-05-26 17:20:37+00:00</td>\n",
|
||||
" <td>fr</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>1311</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>151865</th>\n",
|
||||
" <td>295368</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>True</td>\n",
|
||||
" <td>False</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>...</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>6.0</td>\n",
|
||||
" <td>22.0</td>\n",
|
||||
" <td>2.0</td>\n",
|
||||
" <td>22.0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2021-05-26 17:35:38+00:00</td>\n",
|
||||
" <td>fr</td>\n",
|
||||
" <td>NaN</td>\n",
|
||||
" <td>1311</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"<p>151866 rows × 25 columns</p>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" customer_id birthdate street_id is_partner gender is_email_true \\\n",
|
||||
"0 12751 NaN 2 False 1 True \n",
|
||||
"1 12825 NaN 2 False 2 True \n",
|
||||
"2 11261 NaN 2 False 1 True \n",
|
||||
"3 13071 NaN 2 False 2 True \n",
|
||||
"4 653061 NaN 10 False 2 True \n",
|
||||
"... ... ... ... ... ... ... \n",
|
||||
"151861 295252 NaN 10 False 2 True \n",
|
||||
"151862 295271 NaN 10 False 2 True \n",
|
||||
"151863 295275 NaN 10 False 2 True \n",
|
||||
"151864 295366 NaN 2 False 2 True \n",
|
||||
"151865 295368 NaN 2 False 2 True \n",
|
||||
"\n",
|
||||
" opt_in structure_id profession language ... fidelity \\\n",
|
||||
"0 True NaN NaN NaN ... 0 \n",
|
||||
"1 True NaN NaN NaN ... 0 \n",
|
||||
"2 True NaN NaN NaN ... 0 \n",
|
||||
"3 True NaN NaN NaN ... 0 \n",
|
||||
"4 False NaN NaN NaN ... 0 \n",
|
||||
"... ... ... ... ... ... ... \n",
|
||||
"151861 False NaN NaN NaN ... 0 \n",
|
||||
"151862 False NaN NaN NaN ... 0 \n",
|
||||
"151863 False NaN NaN NaN ... 0 \n",
|
||||
"151864 False NaN NaN NaN ... 1 \n",
|
||||
"151865 False NaN NaN NaN ... 1 \n",
|
||||
"\n",
|
||||
" average_purchase_delay average_price_basket average_ticket_basket \\\n",
|
||||
"0 NaN NaN NaN \n",
|
||||
"1 NaN NaN NaN \n",
|
||||
"2 NaN NaN NaN \n",
|
||||
"3 NaN NaN NaN \n",
|
||||
"4 NaN NaN NaN \n",
|
||||
"... ... ... ... \n",
|
||||
"151861 NaN NaN NaN \n",
|
||||
"151862 NaN NaN NaN \n",
|
||||
"151863 NaN NaN NaN \n",
|
||||
"151864 3.0 33.0 3.0 \n",
|
||||
"151865 6.0 22.0 2.0 \n",
|
||||
"\n",
|
||||
" total_price purchase_count first_buying_date country age \\\n",
|
||||
"0 NaN 0 NaT fr NaN \n",
|
||||
"1 NaN 0 NaT fr NaN \n",
|
||||
"2 NaN 0 NaT fr NaN \n",
|
||||
"3 NaN 0 NaT fr NaN \n",
|
||||
"4 NaN 0 NaT NaN NaN \n",
|
||||
"... ... ... ... ... ... \n",
|
||||
"151861 NaN 0 NaT NaN NaN \n",
|
||||
"151862 NaN 0 NaT NaN NaN \n",
|
||||
"151863 NaN 0 NaT NaN NaN \n",
|
||||
"151864 33.0 1 2021-05-26 17:20:37+00:00 fr NaN \n",
|
||||
"151865 22.0 1 2021-05-26 17:35:38+00:00 fr NaN \n",
|
||||
"\n",
|
||||
" tenant_id \n",
|
||||
"0 1311 \n",
|
||||
"1 1311 \n",
|
||||
"2 1311 \n",
|
||||
"3 1311 \n",
|
||||
"4 1311 \n",
|
||||
"... ... \n",
|
||||
"151861 1311 \n",
|
||||
"151862 1311 \n",
|
||||
"151863 1311 \n",
|
||||
"151864 1311 \n",
|
||||
"151865 1311 \n",
|
||||
"\n",
|
||||
"[151866 rows x 25 columns]"
|
||||
]
|
||||
},
|
||||
"execution_count": 42,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"df1_customerplus_clean"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 43,
|
||||
|
|
Loading…
Reference in New Issue
Block a user