A talk given in November 2016 at IEM Malaysia to engineers, who are new to Python, a broad perspective of what Python is, why it is important to learn it and how it can help in solving/visualization of engineering and scientific tasks and problems.
3. What is Python?
●
A programming language
●
Interpreted
●
Object-oriented
●
High-level
●
Developed by Guido van Rossum from
1989
●
Cross-platform
●
Open-source, freely distributable
4. Python 2 or 3
●
Python 2 or 3 ?
●
Python 2.x is legacy, Python 3.x is the
present and future of the language.
●
Where can I get Python from?
●
Python Official Website
– Standard Python installation
●
Third Party Packagers
– Anaconda
– Enthought Canopy
10. Lift off with Python
DLR German Aerospace Center
VAMPzero: Aircraft Conceptual Design
with Python
11. ●
Johnson Space Center
●
Integrated Planning System
– Uses Python as standard scripting language
●
modular collection of tools for assisting
shuttle pre-mission planning
●
For more info visit :
https://www.python.org/about/success/u
sa/
12. Why Python?
●
Easy to learn
●
Simple, clean syntax
●
As readable as English
●
Write less code
●
3 to 5 time shorter than Java
●
5 to 10 times shorter than C++
●
Higher productivity
13. Why Python? (2)
●
Impressive Standard Libraries
●
Extensive Third Party Libraries
●
Excellent Documentation
●
Powerful & Versatile
●
Build websites
●
Analyze and visualize data
●
Scientific and numeric computing
16. Some other considerations
●
TIOBE index – October 2016
●
Python – 5th
Position
●
Fortran – 28th
Position
●
Intel released its Python distribution in
2016
17. Fortran Vs Python
●
Fortran
●
Heavily optimized static typed compiler
●
World's oldest yet still used language
●
Python
●
Dynamic typed interpreted language
●
Created 1990
18. Fortran Vs Python (2)
●
Fortran
●
Synonymous with scientific computing
●
Only real alternative was C++
●
Including C, only languages supported by
Intel
– Until their Python came along
●
Huge amount of scientific and engineering
code written in Fortran
– And still in use
19. Fortran Vs Python (3)
●
Computer processing time vs
programming time
●
Much easier to learn Python
●
Faster to develop code using Python
1960/70's (Fortran days) Today
Computer Processing
Time
Expensive Cheap
Programming Time Relatively Cheap Expensive
20. Fortran Vs Python (4)
●
Compared with Fortran, the core Python
arrays (lists) are not fast
●
But Python with SciPy and NumPy is a
game changer
●
>90,000 Python packages in pypi
●
Scientific/Engineering Category
●
> 5500 packages
●
In 16 sub-categories
21. Fortran Vs Python
Conclusion
●
Fortran will still be around for some years
●
Existing software needs maintenance
●
But for new software ...
●
Python is a good alternative
– Easy to learn
– Free, open-source
– Numerous packages
– Strong community
22. What can you do with Python?
●
Python by itself not suitable for typical
engineering calculations
●
You also need the numeric, scientific and
plotting libraries
●
NumPy
●
SciPy
●
Matplotlib
●
Anaconda and Enthought Canopy
distributions provide all
23. ●
Some engineering calculations you can do
●
Linear algebra
●
Root finding (non-linear algebra)
●
Linear or nonlinear regression
●
Integration and ordinary differential
equations
●
statistics
●
plotting