Understanding Python Classes
For this week's video, I decided to go back to the basics and talk about how to properly use classes within your Python projects. I personally know that for most people in data-related fields, this way of writing code doesn't really come naturally to us because we're used to following examples in Jupyter Notebooks.
This is how I started as well. But now, I almost never use notebooks anymore and structure all my projects in an Object-Oriented Programming (OOP) way, which is a programming paradigm that focuses on creating reusable and modular code.
Classes allow you to define blueprints for creating objects that encapsulate data and behavior. They provide a way to group related data (attributes) and functions (methods) together into a single unit. By using classes, you can create instances (objects) of that class, each with its own unique set of data.
In this tutorial, I will show you the very basics of how to get started using classes and conclude with an example of how I use a combination of classes and design patterns to create modular code.
Go watch the video here.
40
20 comments
Dave Ebbelaar
7
Understanding Python Classes
Data Alchemy
skool.com/data-alchemy
Your Community to Master the Fundamentals of Working with Data and AI — by Datalumina®
Leaderboard (30-day)
powered by