Let us now walk through the example, line by line, to understand how it achieves the desired result of optimizing the indicated model.
The example begins by importing the Gurobi functions and classes,
as well as the NumPy and SciPy packages:
import numpy as np
Gurobi Python applications should always start with the first line. If you want to use the matrix interface, the next two lines are needed as well.