Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Practical Time Series Analysis

You're reading from  Practical Time Series Analysis

Product type Book
Published in Sep 2017
Publisher Packt
ISBN-13 9781788290227
Pages 244 pages
Edition 1st Edition
Languages
Authors (2):
Avishek Pal Avishek Pal
Profile icon Avishek Pal
PKS Prakash PKS Prakash
Profile icon PKS Prakash
View More author details

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 the constructor function. This job is done by the __init__ method that takes input and assigns them to class variables. The __init__ method can internally call other functions based on the logic of creating the object. Let's define a class about books...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}