0% found this document useful (0 votes)
11 views

10 - SP - Introduction To Python - Demonstration of Its Capabilities in Scientific Research For Civil Engineering

Introduction
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

10 - SP - Introduction To Python - Demonstration of Its Capabilities in Scientific Research For Civil Engineering

Introduction
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Introduction to Python

Demonstration of Its Capabilities in


Scientific Research for Civil Engineering

Sebastian Pißermayr | [email protected]


1
Overview
• What is Python?
• Getting started | Installation
• Basic Code Syntax
• Examples

2
Python
• a high-level, interpreted programming language
• Designed by Guido van Rossum and first released in 1991
• Multi-Platform Compatible (Win, Linux, macOS)

3
Python is …

VERSATILE READABLE POWERFUL COMMUNITY-


DRIVEN

4
Growth of Python

source: source:
https://machinelearningmastery.com/python- https://medium.com/@abdullahassami/why-you-
growing-platform-applied-machine-learning/ should-start-learning-python-in-2023-f79ecb0525bc
5
Potential
Usecases for
Python
• Data Analysis and Data
Visualization
• Machine Learning and Artificial
Intelligence
• Scientific Computing
• Automation and Scripting
• Web Development
• Many More…

6
Advantages and Drawbacks

Pros Cons
• Free and Open-Source • speed limitations
• Vast and versatile Libraries • not memory efficient
• Supportive Community
• High-Level-Programming Language

• High Productivity
• High readability
• Well described Error Messages

7
Overview
• What is Python?
• Getting started | Installation
• Basic Code Syntax
• Examples

8
Getting started | Installation
• Python 2, Python 3.11, … • VSCode
• Pycharm
• Jupyter
• Spyder
• Anaconda

Python Distribution Integrated Development Environment (IDE)


9
Getting started | Installation

Python Distribution Integrated Development Environment (IDE)


https://www.python.org/downloads/ e.g.: https://code.visualstudio.com/download
10
Getting started | Installation

Python Distribution Integrated Development Environment (IDE)


11
Python Console
12
Python Script VS. Jupyter Notebooks

Python Scripts Jupyter Notebooks


13
Python Script VS. Jupyter Notebooks
• standalone programs • interactive document
• automation and • structured in cells
reproducibility • code, text, formulas and images
• LaTeX, Markdown
• teaching and showing

Python Scripts Jupyter Notebooks


14
Overview
• What is Python?
• Getting started | Installation
• Basic Code Syntax
• Packages and Examples

15
Python Basics
Output
16
Python Basics
Dynamically Typed Variables and Types
17
Python Basics
Control Structures (Conditional Statement and Loop)
18
Python Basics
Functions
19
Python Basics
Modules | Packages
20
Overview
• What is Python?
• Getting started | Installation
• Basic Code Syntax
• Packages and Examples

21
Getting started | PIP
Package Installer for Python

install via • numpy „numerical operations“


command line or • pandas „excel for python“
in your IDE:
• scipy signal processing, optimization, …
• „pip install …“
• matplotlib 2D, 3D Plots and Animations
• sympy Symbolic and numeric calculations
• seaborn Complex plots done easy
• pyvista 3D Plots and Animations
• PySide6 User Interface (Matplotlib, SQL,…)

22
„numerical operations“

• Numpy Arrays
• Curve fitting (Polynomial fit, Interpolation, …)
• Matrix Operations
• Fourier Transformation

Python Modules | Packages


Examples: Numpy
23
„numerical tools and algorithms“

• Sparse Arrays
• Input/Output (Matlab, HDF5, NetCFD , Images, WAV, TXT, …)
• Optimization (Nelder-Mead, BFGS, Differential Evolution, …)
• Signal Processing (Filtering, Peak Identification, …)
• Integration, Deviation, ….

Python Modules | Packages


Examples: Scipy
24
„2D and 3D plotting and Animations“

Python Modules | Packages


Examples: Matplotlib
25
Python Modules | Packages
Examples: Seaborn
26
https://plotly.com/python/plotly-express/

Python Modules | Packages


Examples: Plotly Express
27
Code Examples
Interactive single mass oscillator
28
Showcase | AIT Tool
Noise Barrier GUI
29
Essential Resources & Tools
Package Jupyter Notebook Tutorials
Documentation Numpy https://github.com/KeithGalli/NumPy/blob/master/NumPy%20Tutorial.ipynb
• matplotlib
Scipy https://github.com/lukepolson/youtube_channel/blob/main/Python%20Tutorial%20Series/scipy_essentials.ipynb
• numpy Sympy https://github.com/lukepolson/youtube_channel/blob/main/Python%20Tutorial%20Series/sympy1.ipynb
• pandas Plotly https://github.com/lukepolson/youtube_channel/blob/main/Python%20Tutorial%20Series/scipy_essentials.ipynb
• scipy
• seaborn cheat sheets
• sympy Python Beginners
• plotly express Pandas
Seaborn
matplotlib
numpy
scipy - linalg

30
Find your learning resources!

31

You might also like