Lecture 0: Course Information
END 201E Industrial Engineering Mehmet Ali Ergün, Ph.D.
Applications in Python
Instructors
1. Mehmet Ali Ergün (First Half)
❖ PhD: Industrial and Systems Engineering, University of Wisconsin-Madison
❖ MSc: Industrial and Systems Engineering, University of Wisconsin-Madison
❖ MSc: Computing and Information Science, Masdar Institute of Science and Technology
❖ BS: Computer Engineering, Bogazici University, BS
❖ Worked at İstanbul Şehir University between 2018-2020
❖ Email: mergun@[Link]
❖ Office Hours: By appointment
2. Mehmet Yasin Ulukuş (Second Half)
2
About the TA
❖ Abdullah Emin Kazdaloğlu ( kazdaloglua@[Link] )
3
Course Information
About the Course
❖ This course aims you to develop skills implementing industrial engineering
related problems in Python
❖ Lists and Dictionaries in Python
❖ Numpy and Pandas libraries
❖ Selected applications from topics:
❖ Forecasting methods, Heuristic Optimization Methods, Scheduling Algorithms,
Classification and Clustering Methods, Monte-Carlo Simulations
5
Grading Scheme
❖ Performance evaluation metrics:
Grading Item Count Weight
Participation 1 10%
Midterms 2 90% ( 45% each)
6
Grading Scheme
❖ The letter grades will be assigned according to the new grading regulations
announced by the student affairs:
❖ [Link]
[Link]
7
Lectures
❖ Lecture hours:
❖ Tuesday: 09:30-11:30 (unless announced otherwise, follow invitations from
Ninova)
❖ Room
❖ Wherever you are comfortable (with Internet Connection)
❖ Attendance at lectures is required. You are assumed to be in class during the
lectures and any announcement and/or assignments are assumed to be
heard.
Email Policy
❖ You are welcome to ask questions and make inquiries to both instructors and the TA
via email.
❖ When you send an email, please make sure:
❖ Put [END201E] (including square brackets – no space) in the subject field together
with an appropriate subject
❖ Example: [END201E] A question regarding assignment 2
❖ Observe the courtesy rules
❖ Allow us 2-3 days to reply before sending a reminder.
Assignments
❖ There will be an assignment roughly every 2 weeks (except the first few weeks of class)
❖ Assignments must be done individually, unless stated otherwise
❖ You will be given strict instructions about each submission and you are to follow them
carefully. Any failure following the instructions will result in 30% reduction in your grade.
❖ Late policy:
❖ You can work on your assignment until the midnight of the due date. Late assignments
are accepted via email only between 00:00 – 00:15 (15 mins following the due date). Any
submission outside of this time window will be ignored
❖ Email submissions are to be made to the TA (not to the instructors)
Assignment Grading and Demo
❖ All assignments will be programming assignments and graded according to the output
❖ Means if your code does not produce required output, you will not receive any credit
❖ It is your responsibility to make sure your code works as intended. We will make efforts to fix
your code for structural errors (i.e. unnecessary code, scope error etc.) but you will incur 30%
loss of your mark. Algorithmic errors will not be corrected.
❖ Your submission will be tested with several inputs. Each correct output will count towards your
grade
❖ Your submissions will be run through a similarity checker. Your code will be
compared to your peers and to the outputs of Chat GPT and its variants.
❖ If the similarity is above a certain threshold, disciplinary actions will be taken.
Academic Integrity
❖ You are encouraged to share ideas with each other on class assignments
orally.
❖ However, the assignment you turn in must be your own work.
❖ You are not allowed to obtain, look at, copy/paste from any other
individual. This includes the internet.
❖ Absolutely no exchange of code files
I am expected to…
❖ Teach lectures
❖ Guide your learning process
❖ Give you feedback in timely fashion
13
You are expected to…
❖ Learn
❖ Attend lectures and participate (ask questions as you have them)
❖ Plan ahead and study hard, if…
❖ You need a high grade for your GPA
❖ You need to pass the course because of a certain reason
❖ Be polite
❖ Please refrain from use of cellular phones and frequent in-and-out’s during
the lectures
14
Introduction
What is Python?
❖ Python is an interpreted, high-level, general-purpose programming language.
❖ Emphasizes code readability with its notable use of significant whitespace.
❖ Python is dynamically typed and garbage-collected.
❖ It supports multiple programming paradigms,
❖ Structured,
❖ Object-oriented
❖ Functional programming
❖ Often described as a "batteries included" language due to its comprehensive standard
library
16
Interpreted vs Compiled
❖ Compiled languages:
Whole body of the
program is optimized and
translated into machine
language before runtime
❖ Interpreted languages: The
code is read and executed
one line at a time.
17
Interpreted vs Compiled
18
How to Setup Your Environment
❖ We will see both versions as each has their pros and cons
❖ Harder Way:
❖ Install Python and pip
❖ Install and manage required libraries …
❖ Easy Way:
❖ Install Anaconda
19
Python Packages
❖ Python packages are roughly a
collection of functions and/or data
structures that works as and extension
to python standard library
❖ By installing and importing packages
into your code, you can easily extend
the capabilities of Python
❖ Packages are often developed by the
Python users and free to use
20
Solution #2: Use Anaconda (or similar)
❖ Anaconda is a free and open-source distribution
of the Python and R programming languages
for scientific computing (data science, machine
learning applications, large-scale data
processing, predictive analytics, etc.), that aims to
simplify package management and deployment
(Wikipedia)
❖ Anaconda distribution comes with 1,500
packages selected from PyPI as well as
the conda package and virtual environment
manager.
21
Solution #2: Use Anaconda (or similar)
❖ It also comes with Jupyter Notebook, Spider and
other IDEs that you may need
❖ Anaconda manages packages in a way that the
dependencies do not cause the problem we
talked earlier
❖ Drawback: You may not be able to use the latest
version of all packages
❖ Pip gives you more control and Anaconda comes
with easy management
22
Anaconda Navigator
23
Jupyter Notebook
❖ The Jupyter Notebook is an
open-source web
application that allows you
to create and share
documents that contain live
code, equations,
visualizations and narrative
text
❖ Let’s open and explore
Jupyter Notebook…
24
Spyder
❖ Spyder is a scientific
development environment
written in Python, for
Python, and designed by
and for scientists, engineers
and data analysts.
❖ It offers a combination of
the editing, analysis,
debugging, and profiling
functionality.
25
Python Notes: Mutable vs Immutable
❖ Since everything in Python is an Object, every variable holds an object
instance.
❖ When an object is initiated, it is assigned a unique object id. Its type is
defined at runtime and once set can never change, however its state can be
changed if it is mutable.
❖ Simply put, a mutable object can be changed after it is created, and
an immutable object can’t.
26
Python Notes: Mutable vs Immutable
27
Python Notes: Mutable vs Immutable
Variable Memory
number 5 Id =140704681665040
15 Id =140704681665360
another_number
28
Immutability and Functions
❖ If an immutable object is used as
a parameter to a function, only its
value is passed to the function.
This notion is called “passing by
value”
❖ What does this mean for an
immutable variable?
❖ The changes to the value of the
variable within the scope of the
function do not affect its actual
value
29
Immutability and Functions
❖ Want your function to change the value of a mutable object?
❖ Return and assign
30
Immutability and Functions
❖ If a mutable object is used as a
parameter to a function, its
reference is passed to the function.
This notion is called “passing by
reference”
❖ What does this mean for a mutable
object?
❖ The changes to the object within
the scope of the function do
change its actual value(s)
31