An Introduction to Object-Oriented Programming in Python

Опубликовано: 27 Март 2026
на канале: YUNIKARN
69
4

【Online Courses】
⚡Getting Started with Stata: (24 lectures + 4 assignments = 5.5 hours content): available on Udemy: https://www.udemy.com/course/getting-...

⚡Applied Time Series using Stata (29 lectures + 4 assignments = 6.5 hours content): available on Udemy: https://www.udemy.com/course/applied-...

This video introduces Object-Oriented Programming (OOP) in Python. We explain the basic principles by building a staff management system. Our first class is the Staff class. Attributes are introduced to store information on instances of a class. Magic methods (or Dunder methods “Double Under Underscores”) are used to initialize an instance and to modify string representations. Finally, I show you how to use modules to organise your code in a more efficient manner. Many Data Scientists do not know much about OOP, which is a mistake in my view. The code is available on GitHub (https://github.com/GerhardKling/Pytho....

Chapters
0:00 Introduction to OOP
0:21 Design Staff Management System
1:02 Your First Class
2:09 Attributes
2:35 Magic Methods
4:39 Modules
7:46 Methods
10:39 The _repr_ Method

The course
This video belongs to the course "Python for Data Science", which introduces Python and its use in the context of data analysis, machine learning, and simulations.

The channel
YUNIKARN focuses on publishing educational content in applied statistics, mathematics, and data science. In these fields, programming skills have become essential. Hence, we cover various programming languages including Python, Stata, and C++ to tackle problems and for fun.

Stay in touch
Please leave comments or follow us on Twitter (  / gerhardklings  . DMs are open.

Hashtags
#datascience #python #pythonprogramming