Quicksum is giving keyerror: '540187', and sum is giving fatal windows error
AnsweredSo I am receiving this error regarding quicksum, but it is vague. My code is a bit old, I am not sure if it's a new version issue. Here is the line of my code where this bug occurs.
"obj = (quicksum((1-F[i,j,k])*G[w]*M[w] for k in K for j in J for i in I)) + (quicksum(L[i] for i in I))"
The error is:
File "gurobi.pxi", line 3254, in gurobipy.quicksum
File "...." line 108, in <genexpr>
obj = ....
KeyError: '540187'
0
-
A KeyError is raised when a mapping (dictionary) key is not found in the set of existing keys, see Python’s documentation.
So, you should check the definition of L, G, M.0
Please sign in to leave a comment.
Comments
1 comment