add prefix to customer_id
This commit is contained in:
parent
979c0fe6a8
commit
b71f842fe4
|
@ -122,7 +122,10 @@ def dataset_construction(min_date, end_features_date, max_date, directory_path):
|
||||||
dataset = pd.merge(df_customer_product, y, on = ['customer_id'], how = 'left')
|
dataset = pd.merge(df_customer_product, y, on = ['customer_id'], how = 'left')
|
||||||
|
|
||||||
# 0 if there is no purchase
|
# 0 if there is no purchase
|
||||||
dataset[['y_has_purchased']].fillna(0)
|
dataset[['y_has_purchased']].fillna(0)
|
||||||
|
|
||||||
|
# add id_company prefix to customer_id
|
||||||
|
dataset['customer_id'] = directory_path + '_' + dataset['customer_id'].astype('str')
|
||||||
|
|
||||||
return dataset
|
return dataset
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user