Classes and objects

A class is a logical grouping of variables and functions. The class keyword is used in Python to define such logical groupings. A class often represents a real-life entity, for example, book, author, publishers, and so on. Entities have properties, which are represented by the variables defined in a class. Functions in a class, often referred to as methods, define how data about an instance of the entity can be captured and transformed. An instance of a class is a single realization of the entity. For example, book is an entity whereas Practical Time Series Analysis is an instance of book. To create instances, we initiate an object of a class. Object definition involves assigning values to the variables of the class through ...

Get Practical Time-Series Analysis now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.