Correction erreur pour entreprise 101
This commit is contained in:
		
							parent
							
								
									23981e3cbc
								
							
						
					
					
						commit
						3c4f851d16
					
				|  | @ -30,29 +30,29 @@ def export_dataset(df, output_name): | |||
|         df.to_csv(file_out, index = False) | ||||
| 
 | ||||
| ## 1 - Cleaning of the datasets | ||||
| for tenant_id in ("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "101"):  | ||||
| for tenant_id in ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "101"]: | ||||
|      | ||||
|     # Timer | ||||
|     start = time.time() | ||||
|      | ||||
|     # # Cleaning customerplus | ||||
|     # df1_customerplus_clean = preprocessing_customerplus(directory_path = tenant_id) | ||||
|      | ||||
|     # ## Exportation  | ||||
|     # export_dataset(df = df1_customerplus_clean, output_name = "0_Input/Company_"+ tenant_id +"/customerplus_cleaned.csv") | ||||
|      | ||||
|     # # Cleaning target area | ||||
|     # df1_target_information = preprocessing_target_area(directory_path = tenant_id) | ||||
|     # ## Exportation  | ||||
|     # export_dataset(df = df1_target_information, output_name = "0_Input/Company_"+ tenant_id +"/target_information.csv") | ||||
|      | ||||
|     # # Cleaning campaign area | ||||
|     # df1_campaigns_information = preprocessing_campaigns_area(directory_path = tenant_id) | ||||
|     # ## Exportation  | ||||
|     # export_dataset(df = df1_campaigns_information, output_name = "0_Input/Company_"+ tenant_id +"/campaigns_information.csv") | ||||
|     # Cleaning customerplus | ||||
|     df1_customerplus_clean = preprocessing_customerplus(directory_path = tenant_id) | ||||
|      | ||||
|     ## Exportation  | ||||
|     # export_dataset(df = df1_campaigns_information, output_name = "1_Temp/Company 1 - Campaigns dataset clean.csv") | ||||
|     export_dataset(df = df1_customerplus_clean, output_name = "0_Input/Company_"+ tenant_id +"/customerplus_cleaned.csv") | ||||
|      | ||||
|     # Cleaning target area | ||||
|     df1_target_information = preprocessing_target_area(directory_path = tenant_id) | ||||
|     ## Exportation  | ||||
|     export_dataset(df = df1_target_information, output_name = "0_Input/Company_"+ tenant_id +"/target_information.csv") | ||||
|      | ||||
|     # Cleaning campaign area | ||||
|     df1_campaigns_information = preprocessing_campaigns_area(directory_path = tenant_id) | ||||
|     ## Exportation  | ||||
|     export_dataset(df = df1_campaigns_information, output_name = "0_Input/Company_"+ tenant_id +"/campaigns_information.csv") | ||||
|      | ||||
|     # Exportation  | ||||
|     export_dataset(df = df1_campaigns_information, output_name = "1_Temp/Company 1 - Campaigns dataset clean.csv") | ||||
| 
 | ||||
|     if tenant_id == "101": | ||||
|         # Cleaning product area | ||||
|  |  | |||
|  | @ -145,7 +145,7 @@ def preprocessing_tickets_area(directory_path): | |||
|     tickets.rename(columns = {'id' : 'ticket_id'}, inplace = True) | ||||
|      | ||||
|     if directory_path == '101': | ||||
|         tickets_1 = tickets[['id', 'purchase_id', 'product_id', 'is_from_subscription', 'type_of', 'supplier_id']] | ||||
|         tickets_1 = tickets_1[['id', 'purchase_id', 'product_id', 'is_from_subscription', 'type_of', 'supplier_id']] | ||||
|         tickets_1.rename(columns = {'id' : 'ticket_id'}, inplace = True) | ||||
| 
 | ||||
|     # Base des fournisseurs | ||||
|  | @ -294,6 +294,5 @@ def uniform_product_df(directory_path): | |||
|         products_purchased_reduced_1 = products_purchased_1[['ticket_id', 'customer_id', 'purchase_id' ,'event_type_id', 'supplier_name', 'purchase_date',  'amount', 'is_full_price', 'name_event_types', 'name_facilities', 'name_categories', 'name_events', 'name_seasons', 'start_date_time', 'end_date_time', 'open']] # 'type_of_ticket_name', 'children', | ||||
|          | ||||
|         return products_purchased_reduced, products_purchased_reduced_1 | ||||
|          | ||||
|     else :  | ||||
|         return products_purchased_reduced | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user