1) Intro To Python
1) Intro To Python
1) Intro To Python
Lecture 1: Introduction
vision.seecs.edu.pk
Content
• Why programming for ChE Students?
• Why Python?
• Course Outline
2
Why Programming course?
3
Why Programming for ChE Students?
Why Programming for ChE Students?
Why Programming for ChE Students?
Why Programming for ChE Students?
Why Programming for ChE Students?
9
10
https://jckantor.github.io/ND-Pyomo-Cookbook/notebooks/05.02-Exothermic-CSTR.html
Python library ChemPlot for clustering the chemical space and selecting specific clusters
https://chemistry-europe.onlinelibrary.wiley.com/doi/10.1002/cmtd.202200005
11
Produced Water Chemistry and Isotope Analysis with Python and Pandas
12 https://hatarilabs.com/ih-en/produced-water-chemistry-and-isotope-analysis-with-python-and-pandas-tutorial
Taking the leap between analytical chemistry and artificial intelligence
13 https://www.sciencedirect.com/science/article/abs/pii/S0003267021002294#undfig1
Python for Chemical Engineering Applications
Python used for chemical engineering tasks:
14
Python for Chemical Engineering Applications
3. Visualization: Matplotlib is a Python library for creating
visualizations. It can be used to create plots and charts of process
variables, such as temperature and flow rate, to aid in understanding
and analyzing data.
15
No Worries…
16
Course Objectives
Theory - 75%
• 30% Mid
• 10% Quizzes
• 10% Assignments
• 50% Final Exam
Labs - 25 %
Text Book: 1. Python Basics: A Practical Introduction to Python 3, 4th Edition, David
Amos, Fletcher Heisler, and Joanna Jablonski
???
22
Algorithm
vs
Psudocode
???
23
High-level Language
vs
Low-level Language
???
24
Syntax
vs
Semantics
???
25
Definitions
26
Using Google Colab
• Colab is an interactive editor for Python in the cloud
• Try the example above. We’ll explain what we wrote in one moment.
• Bonus: You can also run the contents of a cell using `ctrl+enter`
Printing
• Printing allows Python to talk to us. In the last example we used
printing to make Python say “Hello World”
• We can make Python say anything by writing a sentence, wrapped in
double quotes, and passing it as the input to print(…)
• The print function can also be used to perform arithmetic. Just replace
the input to of the print() with the expression you want to evaluate
• Note, in this case, we don’t need quotes. They were only to let Python
know that the input to print(…) was text
Printing
• You can print multiple things (which will be automatically separated by
spaces) by passing more than one input to print(…)
• We separate each input using a comma