add warning

This commit is contained in:
2025-11-27 00:39:32 +01:00
parent 07262e5c8f
commit 5b87fde8ed

View File

@@ -92,11 +92,12 @@ if __name__ == "__main__":
# align elasticity with price data by productId, fill missing with 0 # align elasticity with price data by productId, fill missing with 0
if not price_data.empty and elasticity_df is not None and not elasticity_df.empty: if not price_data.empty and elasticity_df is not None and not elasticity_df.empty:
# TODO FIX: we might have duplicate productIds
price_data_merged = price_data.merge( price_data_merged = price_data.merge(
elasticity_df[['productId', 'elasticity']], elasticity_df[['productId', 'elasticity']],
on='productId', on='productId',
how='left' how='left'
).fillna({'elasticity': 0.0}) ).fillna({'elasticity': 0.0}) # is it possible we are spilling some elasticities into other products
prices = price_data_merged['price'].values prices = price_data_merged['price'].values
elasticities = price_data_merged['elasticity'].values elasticities = price_data_merged['elasticity'].values