From 169ce53c88984bfc0d19730e72d9d9ac98b7ab62 Mon Sep 17 00:00:00 2001 From: frodrigue-ensae Date: Sat, 2 Mar 2024 12:05:51 +0000 Subject: [PATCH] base_stat_desc --- Spectacle/Stat_desc.ipynb | 1020 +++++++++++++++++++++++++++++++++---- 1 file changed, 929 insertions(+), 91 deletions(-) diff --git a/Spectacle/Stat_desc.ipynb b/Spectacle/Stat_desc.ipynb index 98db314..0590e41 100644 --- a/Spectacle/Stat_desc.ipynb +++ b/Spectacle/Stat_desc.ipynb @@ -117,17 +117,7 @@ { "cell_type": "code", "execution_count": 6, - "id": "1c4a07ec-cf8e-420e-88f0-5eb4b83e2bc1", - "metadata": {}, - "outputs": [], - "source": [ - "directory_path='10'" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "4249cdcd-ef59-4dd6-a345-4218bb90e526", + "id": "afd044b8-ac83-4a35-b959-700cae0b3b41", "metadata": {}, "outputs": [ { @@ -141,7 +131,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_1282/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", + "/tmp/ipykernel_8330/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n" ] }, @@ -156,7 +146,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_1282/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", + "/tmp/ipykernel_8330/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n" ] }, @@ -171,28 +161,208 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_1282/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", - " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n" + "/tmp/ipykernel_8330/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", + " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n", + ":27: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n" ] - } - ], - "source": [ - " # Import customerplus\n", - "df_customerplus_clean_0 = display_databases(directory_path, file_name = \"customerplus_cleaned\")\n", - "df_campaigns_information = display_databases(directory_path, file_name = \"campaigns_information\", datetime_col = ['opened_at', 'sent_at', 'campaign_sent_at'])\n", - "df_products_purchased_reduced = display_databases(directory_path, file_name = \"products_purchased_reduced\", datetime_col = ['purchase_date'])\n" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "e56aa16f-a167-4bff-9f8b-f764d1f28ebd", - "metadata": {}, - "outputs": [ + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File path : projet-bdc2324-team1/0_Input/Company_11/customerplus_cleaned.csv\n" + ] + }, { "name": "stderr", "output_type": "stream", "text": [ + "/tmp/ipykernel_8330/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", + " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File path : projet-bdc2324-team1/0_Input/Company_11/campaigns_information.csv\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_8330/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", + " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File path : projet-bdc2324-team1/0_Input/Company_11/products_purchased_reduced.csv\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_8330/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", + " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n", + ":27: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File path : projet-bdc2324-team1/0_Input/Company_12/customerplus_cleaned.csv\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_8330/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", + " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File path : projet-bdc2324-team1/0_Input/Company_12/campaigns_information.csv\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_8330/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", + " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File path : projet-bdc2324-team1/0_Input/Company_12/products_purchased_reduced.csv\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_8330/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", + " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n", + "/tmp/ipykernel_8330/2987234667.py:8: DtypeWarning: Columns (4,8,10) have mixed types. Specify dtype option on import or set low_memory=False.\n", + " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n", + ":27: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File path : projet-bdc2324-team1/0_Input/Company_13/customerplus_cleaned.csv\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_8330/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", + " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File path : projet-bdc2324-team1/0_Input/Company_13/campaigns_information.csv\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_8330/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", + " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File path : projet-bdc2324-team1/0_Input/Company_13/products_purchased_reduced.csv\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_8330/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", + " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n", + ":27: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File path : projet-bdc2324-team1/0_Input/Company_14/customerplus_cleaned.csv\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_8330/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", + " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File path : projet-bdc2324-team1/0_Input/Company_14/campaigns_information.csv\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_8330/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", + " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File path : projet-bdc2324-team1/0_Input/Company_14/products_purchased_reduced.csv\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_8330/2987234667.py:8: FutureWarning: The argument 'date_parser' is deprecated and will be removed in a future version. Please use 'date_format' instead, or read your data in as 'object' dtype and then call 'to_datetime'.\n", + " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n", + "/tmp/ipykernel_8330/2987234667.py:8: DtypeWarning: Columns (8,9) have mixed types. Specify dtype option on import or set low_memory=False.\n", + " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser)\n", ":27: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", @@ -201,26 +371,434 @@ } ], "source": [ - " # Creation des KPI\n", - " # KPI sur les campagnes publicitaires\n", - "df_campaigns_kpi = campaigns_kpi_function(campaigns_information = df_campaigns_information) \n", - "\n", - " # KPI sur le comportement d'achat\n", - "df_tickets_kpi = tickets_kpi_function(tickets_information = df_products_purchased_reduced)\n", - "\n", - " # KPI sur les données socio-démographiques\n", - "df_customerplus_clean = customerplus_kpi_function(customerplus_clean = df_customerplus_clean_0)\n", + "#creation de KPI aggreger par thématique\n", "\n", + "nb_compagnie=['10','11','12','13','14']\n", + "for directory_path in nb_compagnie:\n", + " df_customerplus_clean_0 = display_databases(directory_path, file_name = \"customerplus_cleaned\")\n", + " df_campaigns_information = display_databases(directory_path, file_name = \"campaigns_information\", datetime_col = ['opened_at', 'sent_at', 'campaign_sent_at'])\n", + " df_products_purchased_reduced = display_databases(directory_path, file_name = \"products_purchased_reduced\", datetime_col = ['purchase_date'])\n", + " df_campaigns_kpi = campaigns_kpi_function(campaigns_information = df_campaigns_information) \n", + " df_tickets_kpi = tickets_kpi_function(tickets_information = df_products_purchased_reduced)\n", + " df_customerplus_clean = customerplus_kpi_function(customerplus_clean = df_customerplus_clean_0)\n", + " \n", "#creation de la colonne Number compagnie\n", - "df_tickets_kpi[\"Number_compagnie\"]=int(directory_path)\n", - "df_campaigns_kpi[\"Number_compagnie\"]=int(directory_path)\n", - "df_customerplus_clean[\"Number_compagnie\"]=int(directory_path)" + " df_tickets_kpi[\"Number_compagnie\"]=int(directory_path)\n", + " df_campaigns_kpi[\"Number_compagnie\"]=int(directory_path)\n", + " df_customerplus_clean[\"Number_compagnie\"]=int(directory_path)\n", + "\n", + " if nb_compagnie.index(directory_path)>=1:\n", + " customerplus_clean_spectacle=pd.concat([customerplus_clean_spectacle,df_customerplus_clean],axis=0)\n", + " campaigns_information_spectacle=pd.concat([campaigns_information_spectacle,df_campaigns_kpi],axis=0)\n", + " products_purchased_reduced_spectacle=pd.concat([products_purchased_reduced_spectacle,df_tickets_kpi],axis=0)\n", + " else:\n", + " customerplus_clean_spectacle=df_customerplus_clean\n", + " campaigns_information_spectacle=df_campaigns_kpi\n", + " products_purchased_reduced_spectacle=df_tickets_kpi" ] }, { "cell_type": "code", - "execution_count": 11, - "id": "838722c3-4c78-4ffa-a6b6-01ac60f4bdbd", + "execution_count": 7, + "id": "8d3d4a21-3f99-4c48-a102-af33763f7fa7", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
customer_idstreet_idstructure_idmcp_contact_idfidelitytenant_idis_partnerdeleted_atgenderis_email_true...purchase_countfirst_buying_datecountrygender_labelgender_femalegender_malegender_othercountry_frhas_tagsNumber_compagnie
0821538139NaNNaN0875FalseNaN2True...0NaNNaNother001NaN010
18091261063NaNNaN0875FalseNaN2True...0NaNfrother0011.0010
2110051063NaNNaN0875FalseNaN2False...14NaNfrother0011.0010
31766312731NaNNaN0875FalseNaN0False...1NaNfrfemale1001.0010
43810012395NaNNaN0875FalseNaN0True...1NaNfrfemale1001.0010
..................................................................
3431214667645122NaN1534181.00862FalseNaN2True...0NaNNaNother001NaN014
3431224667649122NaN1534177.00862FalseNaN2True...0NaNNaNother001NaN014
3431234667660122NaN1534165.00862FalseNaN0True...0NaNNaNfemale100NaN014
3431244667679122NaN1534132.00862FalseNaN2True...0NaNNaNother001NaN014
3431254667686122NaN1567949.00862FalseNaN0True...0NaNNaNfemale100NaN014
\n", + "

1523688 rows × 29 columns

\n", + "
" + ], + "text/plain": [ + " customer_id street_id structure_id mcp_contact_id fidelity \\\n", + "0 821538 139 NaN NaN 0 \n", + "1 809126 1063 NaN NaN 0 \n", + "2 11005 1063 NaN NaN 0 \n", + "3 17663 12731 NaN NaN 0 \n", + "4 38100 12395 NaN NaN 0 \n", + "... ... ... ... ... ... \n", + "343121 4667645 122 NaN 1534181.0 0 \n", + "343122 4667649 122 NaN 1534177.0 0 \n", + "343123 4667660 122 NaN 1534165.0 0 \n", + "343124 4667679 122 NaN 1534132.0 0 \n", + "343125 4667686 122 NaN 1567949.0 0 \n", + "\n", + " tenant_id is_partner deleted_at gender is_email_true ... \\\n", + "0 875 False NaN 2 True ... \n", + "1 875 False NaN 2 True ... \n", + "2 875 False NaN 2 False ... \n", + "3 875 False NaN 0 False ... \n", + "4 875 False NaN 0 True ... \n", + "... ... ... ... ... ... ... \n", + "343121 862 False NaN 2 True ... \n", + "343122 862 False NaN 2 True ... \n", + "343123 862 False NaN 0 True ... \n", + "343124 862 False NaN 2 True ... \n", + "343125 862 False NaN 0 True ... \n", + "\n", + " purchase_count first_buying_date country gender_label \\\n", + "0 0 NaN NaN other \n", + "1 0 NaN fr other \n", + "2 14 NaN fr other \n", + "3 1 NaN fr female \n", + "4 1 NaN fr female \n", + "... ... ... ... ... \n", + "343121 0 NaN NaN other \n", + "343122 0 NaN NaN other \n", + "343123 0 NaN NaN female \n", + "343124 0 NaN NaN other \n", + "343125 0 NaN NaN female \n", + "\n", + " gender_female gender_male gender_other country_fr has_tags \\\n", + "0 0 0 1 NaN 0 \n", + "1 0 0 1 1.0 0 \n", + "2 0 0 1 1.0 0 \n", + "3 1 0 0 1.0 0 \n", + "4 1 0 0 1.0 0 \n", + "... ... ... ... ... ... \n", + "343121 0 0 1 NaN 0 \n", + "343122 0 0 1 NaN 0 \n", + "343123 1 0 0 NaN 0 \n", + "343124 0 0 1 NaN 0 \n", + "343125 1 0 0 NaN 0 \n", + "\n", + " Number_compagnie \n", + "0 10 \n", + "1 10 \n", + "2 10 \n", + "3 10 \n", + "4 10 \n", + "... ... \n", + "343121 14 \n", + "343122 14 \n", + "343123 14 \n", + "343124 14 \n", + "343125 14 \n", + "\n", + "[1523688 rows x 29 columns]" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "customerplus_clean_spectacle" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "99ce152d-edb9-403a-ad0a-9629ab0f8246", "metadata": {}, "outputs": [ { @@ -301,88 +879,348 @@ " ...\n", " \n", " \n", - " 57138\n", - " 827940\n", + " 254699\n", + " 6837769\n", " 1\n", - " 0.0\n", - " NaT\n", - " 10\n", + " 1.0\n", + " 0 days 23:42:15\n", + " 14\n", " \n", " \n", - " 57139\n", - " 827941\n", + " 254700\n", + " 6875038\n", " 1\n", " 0.0\n", " NaT\n", - " 10\n", + " 14\n", " \n", " \n", - " 57140\n", - " 827942\n", + " 254701\n", + " 6875066\n", " 1\n", " 0.0\n", " NaT\n", - " 10\n", + " 14\n", " \n", " \n", - " 57141\n", - " 827943\n", + " 254702\n", + " 6875099\n", " 1\n", " 0.0\n", " NaT\n", - " 10\n", + " 14\n", " \n", " \n", - " 57142\n", - " 827944\n", + " 254703\n", + " 6875143\n", " 1\n", - " 0.0\n", - " NaT\n", - " 10\n", + " 1.0\n", + " 0 days 01:17:01\n", + " 14\n", " \n", " \n", "\n", - "

57143 rows × 5 columns

\n", + "

688953 rows × 5 columns

\n", "" ], "text/plain": [ - " customer_id nb_campaigns nb_campaigns_opened time_to_open \\\n", - "0 29 4 0.0 NaT \n", - "1 37 3 0.0 NaT \n", - "2 39 4 1.0 0 days 05:16:38 \n", - "3 41 4 1.0 0 days 01:12:29 \n", - "4 44 4 0.0 NaT \n", - "... ... ... ... ... \n", - "57138 827940 1 0.0 NaT \n", - "57139 827941 1 0.0 NaT \n", - "57140 827942 1 0.0 NaT \n", - "57141 827943 1 0.0 NaT \n", - "57142 827944 1 0.0 NaT \n", + " customer_id nb_campaigns nb_campaigns_opened time_to_open \\\n", + "0 29 4 0.0 NaT \n", + "1 37 3 0.0 NaT \n", + "2 39 4 1.0 0 days 05:16:38 \n", + "3 41 4 1.0 0 days 01:12:29 \n", + "4 44 4 0.0 NaT \n", + "... ... ... ... ... \n", + "254699 6837769 1 1.0 0 days 23:42:15 \n", + "254700 6875038 1 0.0 NaT \n", + "254701 6875066 1 0.0 NaT \n", + "254702 6875099 1 0.0 NaT \n", + "254703 6875143 1 1.0 0 days 01:17:01 \n", "\n", - " Number_compagnie \n", - "0 10 \n", - "1 10 \n", - "2 10 \n", - "3 10 \n", - "4 10 \n", - "... ... \n", - "57138 10 \n", - "57139 10 \n", - "57140 10 \n", - "57141 10 \n", - "57142 10 \n", + " Number_compagnie \n", + "0 10 \n", + "1 10 \n", + "2 10 \n", + "3 10 \n", + "4 10 \n", + "... ... \n", + "254699 14 \n", + "254700 14 \n", + "254701 14 \n", + "254702 14 \n", + "254703 14 \n", "\n", - "[57143 rows x 5 columns]" + "[688953 rows x 5 columns]" ] }, - "execution_count": 11, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "df_campaigns_kpi" + "campaigns_information_spectacle" ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "cc6b2dbf-6c99-4517-b3d0-809876045f9f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
customer_idnb_ticketsnb_purchasestotal_amountnb_suppliersvente_internet_maxpurchase_date_minpurchase_date_maxtime_between_purchasenb_tickets_internetNumber_compagnie
0194828829872.0212643.092500718.1493981924.9431028.010
1194843262.0101745.0217361743.0450351.9767010.010
219485131211878.0212649.04474585.2408452563.80390084.010
31948610496.0101944.0776041742.794225201.2833800.010
4194872133.0101742.8777661742.8777660.0000000.010
....................................
9958068847472140.0100.1937500.1937500.0000000.014
9958168847482140.0100.1868060.1868060.0000000.014
9958268847504180.0100.1361110.1361110.0000000.014
9958368847512140.0100.1229170.1229170.0000000.014
9958468847532140.0100.0472220.0472220.0000000.014
\n", + "

764880 rows × 11 columns

\n", + "
" + ], + "text/plain": [ + " customer_id nb_tickets nb_purchases total_amount nb_suppliers \\\n", + "0 19482 88 29 872.0 2 \n", + "1 19484 3 2 62.0 1 \n", + "2 19485 131 21 1878.0 2 \n", + "3 19486 10 4 96.0 1 \n", + "4 19487 2 1 33.0 1 \n", + "... ... ... ... ... ... \n", + "99580 6884747 2 1 40.0 1 \n", + "99581 6884748 2 1 40.0 1 \n", + "99582 6884750 4 1 80.0 1 \n", + "99583 6884751 2 1 40.0 1 \n", + "99584 6884753 2 1 40.0 1 \n", + "\n", + " vente_internet_max purchase_date_min purchase_date_max \\\n", + "0 1 2643.092500 718.149398 \n", + "1 0 1745.021736 1743.045035 \n", + "2 1 2649.044745 85.240845 \n", + "3 0 1944.077604 1742.794225 \n", + "4 0 1742.877766 1742.877766 \n", + "... ... ... ... \n", + "99580 0 0.193750 0.193750 \n", + "99581 0 0.186806 0.186806 \n", + "99582 0 0.136111 0.136111 \n", + "99583 0 0.122917 0.122917 \n", + "99584 0 0.047222 0.047222 \n", + "\n", + " time_between_purchase nb_tickets_internet Number_compagnie \n", + "0 1924.943102 8.0 10 \n", + "1 1.976701 0.0 10 \n", + "2 2563.803900 84.0 10 \n", + "3 201.283380 0.0 10 \n", + "4 0.000000 0.0 10 \n", + "... ... ... ... \n", + "99580 0.000000 0.0 14 \n", + "99581 0.000000 0.0 14 \n", + "99582 0.000000 0.0 14 \n", + "99583 0.000000 0.0 14 \n", + "99584 0.000000 0.0 14 \n", + "\n", + "[764880 rows x 11 columns]" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "products_purchased_reduced_spectacle" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "421c7038-9ee2-4409-a798-ac132c3202ca", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": {