Originally posted by: KeerthivasanC
I have the following output from a model I ran in docplex.cp:
-------------------------------------------------------------------------------
Model constraints: 9, variables: integer: 20, interval: 0, sequence: 0
Solve status: Feasible, Fail status: SearchHasNotFailed
Search status: SearchCompleted, stop cause: SearchHasNotBeenStopped
Solve time: 0.02 sec
-------------------------------------------------------------------------------
TP1_0: 0
TP1_1: 2
TP1_2: 0
TP1_3: 0
TP1_4: 0
TP2_0: 0
TP2_1: 2
TP2_2: 0
TP2_3: 2
TP2_4: 0
TP3_0: 3
TP3_1: 0
TP3_2: 2
TP3_3: 0
TP3_4: 1
TP4_0: 3
TP4_1: 0
TP4_2: 3
TP4_3: 0
TP4_4: 0
I want to transform this output into a dataframe like this:
TP1
|
TP2
|
TP3
|
TP4
|
[TP1_0,TP1_1,TP1_2,TP1_3,TP1_4]
|
[TP2_0,TP2_1,TP2_2,TP2_3,TP2_4]
|
[TP3_0,TP3_1,TP3_2,TP3_3,TP3_4]
|
[TP4_0,TP4_1,TP4_2,TP4_3,TP4_4]
|
Each row will be the list of values corresponding to TPi. A code snippet which does something like this would be great because I am unable to find any resources to manipulate the result of the CP solver in python to create dataframes.
Thanks.
#CPOptimizer#DecisionOptimization