Python API Examples
This section lists a few examples in Python.
These are the same files that can be found in the examples directory of the
distribution, and show the basic usage of the Python API.
There are many more notebooks with examples are available on the new book AMPL Model Colaboratory
and the new book Hands-On Mathematical Optimization with AMPL in Python 🐍.
Example 3: Assign all data to a model and solve it
diet_model.py
This example shows how to: