3.2 Why Python
Python is a programming language used for web development, scientific computing, and other fields.
- Ranked among the top programming languages (see Figure 1).
- Popular in diverse fields: scientific computing and academic research, web development, data science, AI.
- Beginner-friendly: simple, readable syntax.
- Extensive libraries and frameworks: NumPy, Pandas, Matplotlib, Django, Flask, TensorFlow, PyTorch.
- Strong community support: forums, tutorials, documentation.
3.2.1 Disadvantages
Python is not without its drawbacks. Performance depends on the implementation and workload, and pure Python loops may be slower than equivalent compiled implementations in languages such as C or C++. However, Python can be optimized using libraries like NumPy and Cython, which implement performance-critical code in C. Also, there have been improvements in Python's performance over the years. Figure 2 illustrates the performance difference between Python and other programming languages using a simple example of nested loops.
3.2.2 Python in the IEM program
In the IEM program, you will work with several MILP solvers, such as Gurobi and CPLEX, which have Python APIs. You will also use Python libraries like NumPy, Pandas, and Matplotlib for data analysis and visualization.