Originally posted by: ShaCplex
Hi sir,
I have been working in OPL and Java API and now trying to switch to python cplex.
I have a dataframe named odRoutes which has many columns (head() of the dataframe is attached).
I want to create a continuous variable for each of the rows in the dataframe OdRoutes, so I wrote;
mdl = Model("LP")
varODRoute = mdl.continuous_var_dict(valid_ODRoutes_df,name="var_route")
by doing this I am getting the variable names as var_route_0 , var_route_1, etc
the odRoutes dataframe has columns named 'name','productCategory' etc. I want to create variables and name it as var_route_{name+productCategory} for each of the variable.
How can I achieve this? can you please assist me.
regards,
shahul
#CPLEXOptimizers#DecisionOptimization