Ben Bolstad has completed
Working with the Class System in Python
Start course For Free4 hours
3,600 XP
Loved by learners at thousands of companies
Course Description
Object-oriented programming (OOP) is a powerful programming paradigm that reduces the complexity of systems as is employs heavy re-usability of code. OOP leverages the concept of objects and classes. Objects may contain data (known as attributes, stored as instance or class variables) as well as procedures (defined as methods). Objects are generated from blueprints known as classes, which specify the attributes and methods to be generated at the time of object instantiation. This course introduces the internals of classes and the utilization of objects, as well as important object-oriented programming fundamentals such as inheritance, polymorphism, and composition.
For Business
Training 2 or more people?
Get your team access to the full DataCamp library, with centralized reporting, assignments, projects and more- 1
Getting ready for object-oriented programming
FreeIn this chapter we quickly review functions and data structures, as they are building blocks of object-oriented programming. Then we transition into the conceptual definition of objects and classes.
Intro to Object Oriented Programming in Python50 xpUnderstanding Object Dependencies50 xpCreating functions100 xpCreating a complex data type100 xpIntroduction to NumPy Internals50 xpWhat are NumPy Arrays most similar to?50 xpCreate a function that returns a NumPy array100 xpIntroduction to Objects50 xpCreating a class100 xpDifference between a class and an object50 xp - 2
Deep dive into classes and objects
Here, we dive deep into the internals of classes, instantiation of objects, the initialization method, instance variables, class variables, overriding class variables, and methods.
Intro to Classes50 xpUnderstanding what we're building50 xpObject: Instance of a Class100 xpInitializing a Class and Self50 xpThe Init Method100 xpInstance Variables100 xpMultiple Instance Variables100 xpMore on Self and Passing in Variables50 xpClass Variables100 xpOverriding Class Variables100 xpMethods in Classes50 xpMethods I100 xpMethods II100 xpMethods III100 xp - 3
Fancy classes, fancy objects
We create fancier classes with sophisticated methods such as importing datasets, getting descriptive statistics, and renaming columns. Also, we cover best practices for creating and documenting classes according to PEP-8.
Working with a DataSet to Create DataFrames50 xpReturn Statement I50 xpReturn Statement II: The Return of the DataShell100 xpReturn Statement III: A More Powerful DataShell100 xpRenaming Columns and the Five-Figure Summary50 xpData as Attributes100 xpRenaming Columns100 xpSelf-Describing DataShells100 xpOOP Best Practices50 xpNaming classes50 xpGot Characters?50 xpWhich class has appropriate docstrings?50 xp - 4
Inheritance, polymorphism and composition
In this chapter we cover inheritance, which is when we create a class that employs (or 'inherits') all class variables and methods from a 'parent' class. We also cover polymorphism, which is when multiple classes inherit from a single class. Finally, we cover composition, which is when classes employ specific class functionality from other classes without necessarily inheriting from them.
Inheritance50 xpWhy Inheritance?50 xpIs-A or Has-A50 xpAnimal Inheritance100 xpVertebrate Inheritance100 xpInheritance with DataShells50 xpAbstract Class DataShell I100 xpAbstract Class DataShell II100 xpComposition50 xpComposition and Inheritance I100 xpComposition and Inheritance II100 xpWrapping Up OOP50 xp
For Business
Training 2 or more people?
Get your team access to the full DataCamp library, with centralized reporting, assignments, projects and moreDataCamp Content Creator
See MoreCourse Instructor
DataCamp offers interactive R, Python, Spreadsheets, SQL and shell courses. All on topics in data science, statistics, and machine learning. Learn from a team of expert teachers in the comfort of your browser with video lessons and fun coding challenges and projects.
Join over 13 million learners and start Working with the Class System in Python today!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.