Masterclass Series · Batch 51

Masterclass in Python

From the internal format of a Python object through metaclasses, GUI development with Tkinter, and machine learning with scikit-learn — the language understood at the interpreter level.

Schedule: Every Tue – Wed – Thu – Fri
Time: 08:00 PM – 10:00 PM
Starting: 21st April 2026
Duration: 7 Months · ~125 Sessions
Language: Marathi
No Pre-Requisites
Batches Covered: 50
Why This Course

What Makes This Python Course Different

Python-specific depth you won’t find in the market.

01

The Object Internals Approach

When you write x = 5, we show you the int object created in memory — its type pointer, its value, its reference count. Every statement is explained at the level of what the interpreter actually creates, binds, and garbage collects.

02

Complete Scope and Namespace Architecture

Not just “global and local.” You learn the four scopes (local, enclosing, global, built-in), the LEGB rule, how LHS and RHS name lookup differ, and why UnboundLocalError and free variable errors occur — with the fix for each.

03

From Decorators to Metaclasses

Most Python courses stop at classes. We go through the full depth: iterators, context managers, decorators (function decorating function, class decorating class — all four combinations), descriptors, attribute management, and metaclasses. You understand how Python constructs its own type system.

04

Production Application Development

Not just scripts and exercises. You build GUI applications with Tkinter, manage files and directories with the os and sys modules, create child processes and threads, persist data with pickle and shelve, and connect to databases with sqlite3.

05

The Def Statement at the Machine Level

You see the function object, the code object inside it, and the PVM bytecode that executes it. You understand what a function definition actually creates in memory and how the call mechanism works.

06

Language to Machine Learning Pipeline

The course takes you from zero programming knowledge through NumPy, Pandas, Matplotlib, and scikit-learn — including the essential mathematics (linear algebra, statistics, probability) needed for machine learning. Not a separate ML course bolted on — an integrated progression.

Course Progression

How the Course Unfolds

Four phases across ~125 sessions, each building on the last.

Phase 1: The Language — Basics

Fundamentals, data types, control flow, procedural programming, scope architecture, functional programming. The language mastered from first principles.

Phase 2: Application Development

File I/O, operating system interfaces (os and sys modules), process and thread management, data persistence, database connectivity, and GUI development with Tkinter.

Phase 3: The Language — Advanced

OOP, operator overloading, inheritance, exception handling, iterators, context managers, decorators, descriptors, attribute management, and metaclasses.

Phase 4: Data Science and ML

NumPy, Pandas, Matplotlib, essential mathematics, and hands-on machine learning with scikit-learn — from data collection to trained models.

Complete Syllabus

Module-wise Syllabus

This is the full course content across ~125 weekday sessions.

Module 01

Language Fundamentals and the Python Object Model

From “what is computing?” to the internal format of a Python object — type, value, reference count, garbage collection, and the assignment statement understood at the interpreter level.

Programming Fundamentals

  • A brief overview of computer architecture and computer programming
  • Computer languages: machine language, assembly language, high-level languages, and Python’s place among them
  • Core concepts: computing, data, algorithms, data types, I/O, system services, libraries, and software development kits

The Python SDK Ecosystem

  • The standard Python SDK
  • Anaconda SDK for machine learning
  • Flask for web development
  • Packages for automation

The Object Model

  • The ‘Hello, World’ program
  • Structure of a Python program: package/module, class statement, def statement
  • The assignment statement — fundamental ways to create and manipulate data
  • The internal format of a Python object: type, value, and reference count
  • Garbage collection — how Python reclaims memory
  • Variable names, operators, operator arity, prefix/infix/postfix notation, associativity, and precedence
Module 02

Control Flow and Data Types in Depth

Branching, looping, and a systematic deep-dive into every built-in type — with every operation on str, list, tuple, dict, and set covered exhaustively.

Control Flow

  • Block structure and indentation in Python syntax
  • Conditions and conditional execution
  • Branching: if, if-else, if-elif-else
  • Looping: for and while statements
  • break, continue, and pass statements
  • Understanding control flow through flowcharts

Data Type Classification

  • Atomic vs container types
  • Sequential, associative, and unclassified containers
  • Mutable vs immutable types
  • Overview of bool, int, float, str, tuple, list, dict, and set

Atomic Types

  • Boolean, int, and float: creation, processing, and operations
  • Logical operators: not, and, or
  • Arbitrary precision integer arithmetic
  • Integer division vs floating-point division, the exponential operator

Container Types — Complete Operations

  • str: concatenation, scalar multiplication, membership testing, indexing, slicing, index(), count(), strip(), split(), format(), join(), and all inspection methods
  • list: indexing, slicing, assignment, deletion, append(), extend(), insert(), remove(), pop(), sort(), reverse(), copy(), clear()
  • tuple: concatenation, multiplication, indexing, slicing, membership, index(), count()
  • dict: adding/editing/removing key-value pairs, keys(), values(), items(), pop(), update(), get(), setdefault(), fromkeys()
  • set: union(), intersection(), difference(), symmetric_difference(), all update variants, issubset(), issuperset(), isdisjoint(), add(), remove(), discard()
Module 03

Procedural Programming and Scope Architecture

The def statement understood at the memory level — function objects, code objects, PVM bytecode, the four Python scopes, and the LEGB lookup rule.

The Def Statement

  • Writing reusable code: formal parameters, actual parameters, return values, definition and call
  • Internal processing of def: the function object, the code object, and PVM bytecode
  • What a function definition creates in memory — how the code object is stored and executed
  • Pass-by-reference mechanism in Python
  • Global and local variables — observing symbol tables with globals() and locals()

Nested Functions and Closures

  • Nested def statements — tracing control flow and memory allocation of nested procedures
  • Implicit state saving and the function factory design pattern

The Scope-Visibility-Lifetime Model

  • Four scopes: local, enclosing, global, and built-in
  • LHS variable name processing — how Python decides where a name is created
  • The LEGB rule for RHS variable lookup
  • UnboundLocalError: cause and fix
  • Free variable error: cause and fix
  • The global and nonlocal statements

Parameter Passing

  • Non-keyword and keyword syntax for specifying actual parameters
  • Six types of formal parameters: positional, keyword, extra non-keyword, default, keyword-only, and extra keyword
  • The *args and **kwargs technique
  • Static namespace of a function: __code__, __name__, __dict__
Module 04

Functional Programming

Comprehensions, lambda expressions, map, filter, reduce, generators, and the functools package — Python’s functional dimension.

List Comprehensions

  • Single-variable comprehension: basic, with filter, with function, with both
  • Multi-variable comprehension: Cartesian product, generalisation to n variables
  • Applying conditions and functions to multi-variable comprehensions
  • Filtering on the result of a comprehension

Lambda Expressions

  • Creating anonymous function objects with lambda
  • Formal parameters, body expression, and usage patterns

Higher-Order Functions

  • map — applying a function to every element of an iterable
  • filter — selecting elements that satisfy a condition
  • reduce — collapsing an iterable to a single value through repeated application

Generators and `functools`

  • The yield statement and generator objects — lazy evaluation
  • The next() method on generator objects
  • The functools package in depth
Module 05

System Programming: Files, Processes, and Threads

The os and sys packages — file I/O, directory management, process creation with fork/exec, thread management and synchronisation.

The Import System

  • The import statement and its variations: import, from ... import, aliasing with as
  • Package name lookup and PYTHONPATH
  • Systematic handling of package hierarchies

File Handling

  • Opening, creating, reading, writing, and closing files using high-level file APIs
  • Building file utilities: copy command, word count command, cat command
  • Obtaining stat information about files — file attributes

Directory Management

  • Getting and changing the present working directory
  • Listing files, recursively walking directories
  • Removing files, removing directories, renaming files and directories

Process Management

  • Creating child processes with os.fork()
  • Exchanging data between parent and child processes
  • Loading new programs with os.execve()
  • Parent-child synchronisation with os.wait()
  • Process termination with os.exit()

Thread Management

  • Creating new threads
  • Data exchange between parent and child threads
  • Joining and detaching threads
  • Thread synchronisation mechanisms
  • Thread termination
Module 06

Data Persistence and GUI Development with Tkinter

Storing data beyond program lifetime with pickle, DBM, shelve, and sqlite3 — then building desktop GUI applications with Tkinter.

Data Persistence

  • The pickle package: dump() and load() methods
  • DBM files: creation, portability, and access
  • Shelve files: storing built-in types and class instances
  • SQLite3 connectivity — database operations from Python

GUI Application Development with Tkinter

  • ‘Hello, Win’ window — widgets — configuring widgets
  • Top-level windows — Tk and Toplevel widgets — window protocols
  • Dialogs: common dialogs and custom dialogs
  • Binding events to handlers
  • Message and Entry widgets
  • Checkbuttons, radiobuttons, and scale widgets
  • Menus, listboxes, text widgets, scrollbars
  • Grid geometry manager
Module 07

Object-Oriented Programming in Python

The class statement, operator overloading, inheritance, polymorphism, abstract classes, multiple inheritance, and the diamond problem — Python OOP understood from the foundation of its type system.

The Class Statement

  • Writing class statements — the root class type in Python
  • Writing __init__() constructors — creating objects from classes
  • Class methods with @classmethod and static methods with @staticmethod

Operator Overloading

  • Arithmetic and logical operators: __add__, __sub__, __mul__, __truediv__, __floordiv__, __mod__, __and__, __or__, __abs__, __pow__
  • Subscript operator: __getitem__ and __setitem__
  • Call operator: __call__
  • String representation: __str__, __repr__ for print()
  • Length: __len__ for len()

Inheritance

  • Principles of extensibility and reusability in software engineering
  • Deriving one class from another — base class and derived class
  • Inheriting, overriding for extension, and overriding for replacement
  • Information hiding, data encapsulation, and the principle of polymorphism
  • Abstract methods with @abstractmethod from the abc package
  • Creating interfaces with abc.ABCMeta
  • The root base class object — __bases__ and __mro__
  • Multi-level inheritance
  • Multiple inheritance and the diamond problem

Exception Handling

  • Built-in exceptions: NameError, ValueError, TypeError, UnboundLocalError, LookupError, FileNotFoundError, and others
  • Handling exceptions: try-except, multiple except blocks, the as clause, generic handlers
  • try-except-else, try-except-finally, try-except-else-finally
  • Raising exceptions: three ways to write a raise statement
  • Most-derived to most-base ordering in hierarchical exception handling
  • User-defined exceptions — sys.exc_info() — the assert statement
Module 08

Advanced Python: Iterators, Decorators, and Attribute Management

The design patterns and protocols that separate a Python user from a Python engineer — iterators, context managers, all four decorator combinations, the descriptor protocol, and metaclasses.

The Iterator Protocol

  • Expansion of the for loop into a while loop — what Python actually does
  • The __iter__() method and the Type_Iterator class
  • The __next__() method
  • Iterators with read semantics and consumer semantics
  • Writing custom iterators from scratch

The Context Management Protocol

  • The with statement and the as clause
  • __enter__() for post-construction initialisation
  • __exit__() as a handler before destruction
  • Achieving automatic acquire-use-release cycles
  • Writing __exit__() to handle unhandled exceptions in the with block

The Decorator Pattern

  • Python as a language of hooks — an overview of hooking techniques
  • Function decorating a function
  • Function decorating a class
  • Class decorating a function
  • Class decorating a class

Attribute Management

  • The property class: fget, fset, fdelgetter(), setter(), deleter() — creating managed attributes
  • The descriptor protocol: __get__(), __set__(), __delete__() — creating reusable managed attributes
  • Managing attributes via non-existent attribute hooks: __getattr__(), __setattr__(), __delattr__()
  • Managing attributes via universal hooks: __getattribute__(), __setattr__(), __delattr__()

Metaclasses

  • Hooking class creation using metaclasses
  • type.__call__() and type.__new__() — the class creation mechanism
  • Metaclass as a derived class of the root class type
  • Overriding __new__() to extend type.__new__()
  • Overriding __call__() to extend type.__call__()
  • Implementing a custom abstract base class using metaclasses
Module 09

NumPy: Numerical Computing with Arrays

The ndarray at the heart of Python’s scientific computing stack — creation, operations, indexing, broadcasting, vectorisation, and structured arrays.

The ndarray

  • Creating arrays — data types — the dtype option — intrinsic array creation functions

Operations

  • Arithmetic operators and the matrix product
  • Increment and decrement operators
  • Universal functions (ufunc) — element-wise operations
  • Aggregate functions — sum, mean, min, max across axes

Indexing, Slicing, and Advanced Access

  • Indexing, slicing, and iterating over arrays
  • Conditions and boolean arrays — fancy indexing
  • Shape manipulation — reshaping, flattening, transposing
  • Joining and splitting arrays
  • Copies vs views of objects

Advanced NumPy

  • Vectorisation — eliminating explicit Python loops
  • Broadcasting — operating on arrays of different shapes
  • Structured arrays — arrays with named fields
  • Reading and writing array data to binary files
Module 10

Pandas: Data Manipulation and Analysis

Series, DataFrames, indexing, alignment, function application, sorting, correlation, handling missing data, and I/O across CSV, HTML, XML, Excel, and JSON.

Core Data Structures

  • The Series — one-dimensional labelled array
  • The DataFrame — two-dimensional labelled data structure
  • Index objects — reindexing, dropping, arithmetic and data alignment

Operations and Analysis

  • Operations between DataFrames and Series — flexible arithmetic methods
  • Function application: element-wise mapping, row/column application, statistical functions
  • Sorting and ranking
  • Correlation and covariance
  • Handling NaN: assigning, filtering, and filling missing values

I/O Operations

  • Reading and writing CSV and text files — parsing with regular expressions
  • Reading and writing HTML files
  • Reading and writing XML files
  • Reading and writing Microsoft Excel files
  • JSON data — reading and writing
Module 11

Data Visualisation with Matplotlib

The three-layer architecture of Matplotlib — from simple line charts through 3D surfaces, with full control over every visual element.

Architecture and Basics

  • The Matplotlib architecture: backend layer, artist layer, scripting layer
  • pylab and pyplot — a simple interactive chart window
  • Setting plot properties — working with Matplotlib and NumPy together
  • Working with kwargs — multiple figures and axes

Chart Elements and Export

  • Adding text, grids, and legends
  • Saving charts: as code, as HTML, as image files
  • Handling date values on axes

Chart Types

  • Line charts
  • Histograms
  • Bar charts: horizontal, multi-series, stacked, with Pandas DataFrames
  • Pie charts
  • Advanced: contour plots, polar plots
  • The mplot3d toolkit: 3D surfaces, 3D scatter plots, 3D bar charts
Module 12

Machine Learning with scikit-learn

From essential mathematics through the ML development cycle — data collection, feature engineering, model training, and evaluation using scikit-learn’s estimator-transformer-predictor architecture.

Essential Mathematics

  • Basics of matrices, vectors, and linear algebra
  • Basics of statistics: central tendencies, dispersion, correlation
  • Basics of probability: dependence, independence, conditional probability, Bayes’ theorem, random variables, normal distribution
  • Hypothesis and inference: p-values, confidence intervals, p-hacking

Data Science Foundations

  • Collecting, exploring, cleaning, munging, and manipulating data
  • ML strategy categorisation: supervised, unsupervised, semi-supervised, reinforcement, deep learning
  • Batch vs online ML — instance-based vs model-based ML
  • The ML application development cycle — sourcing datasets

The scikit-learn Architecture

  • Estimators, transformers, and predictors
  • Performance measures: Mean Absolute Error, Root Mean Absolute Error
  • Creating test and training sets: random sampling, binomial distribution, stratified sampling
  • Correlation matrices and visualising correlations

Data Preprocessing

  • Imputers: SimpleImputer, KNNImputer, IterativeImputer
  • Transformers: OrdinalEncoder, OneHotEncoder, MinMaxScaler, StandardScaler, RBF-kernel

Hands-On Machine Learning Techniques

  • K-Nearest Neighbours (KNN)
  • Naive Bayes
  • Simple linear regression
  • Multiple regression
  • Logistic regression
  • Decision trees

Ready to Master Python?

Batch 51 starts 21st April 2026. No pre-requisites. First week is open for all.

₹11,800 (₹10,000 + ₹1,800 GST)
Register Now