Skip to main content

KeyError 0 for summing variables in objective function (Using Python)

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Jaromił Najman
    • Gurobi Staff Gurobi Staff

    Hi Quentin,

    \(\texttt{P1}\) is a tupledict so it has to be accessed via \(\texttt{P1[a,b]}\).

    Best regards,
    Jaromił

    1
  • Quentin De Boever
    • Gurobi-versary
    • First Comment
    • Curious

    Jaromil,

    Thank you! Simple mistake, but I'm still new to Gurobi & Python, so hopefully I'll get better!

    Cheers

    0

Post is closed for comments.