Data Science, Machine Learning, Causal Inference, AI, Linear Programming.
cate.to_numpy() num_custs = len(costs) num_treatments = len(costs[0]) # x[i, j] is an array of 0-1 variables, which will be 1 if customer i is assigned to treatment j. x = {} for i in range(num_custs): for j in range(num_treatments): x[i, j] = solver.IntVar(0, 1, '') # Each customer is assigned to