Thoughts, notes, and explanations on Python, Data Structures, Algorithms, Machine Learning, and learning how to learn effectively.
This section will grow over time with structured posts and practical insights.
Thoughts, notes, and explanations on Python, Data Structures, Algorithms, Machine Learning, and learning how to learn effectively.
This section will grow over time with structured posts and practical insights.

π’ NumPy Masterclass and Practice Sheet From Zero to Confident - A Beginnerβs Guide to Numerical Computing in Python Who is this for? You know Python basics - lists, loops, functions - and you want to level up into data science. NumPy is your first real step. Everything in data science (Pandas, Scikit-learn, TensorFlow) is built on top of it. π Table of Contents What is NumPy and Why Should You Care? Installing and Importing NumPy Creating Arrays Array Attributes Indexing and Slicing Array Operations - Math Made Easy Universal Functions (ufuncs) Aggregation Functions Reshaping and Transposing Stacking and Splitting Arrays Boolean Masking and Fancy Indexing Broadcasting Working with Random Numbers Linear Algebra with NumPy Sorting and Searching Copies vs Views Saving and Loading Arrays Practice Questions What We Covered + Whatβs Next 1. What is NumPy and Why Should You Care? Python lists are flexible and easy to use - but they are slow when it comes to heavy number crunching. If you have a million exam scores and want to find the average, a Python loop will take noticeably longer than it should. ...

πΌ Pandas Masterclass From Raw Data to Real Insights - A Beginnerβs Guide to Data Analysis in Python Who is this for? Youβve done the NumPy Masterclass (or know the basics of Python and arrays). Now you want to work with real tabular data - rows, columns, missing values, merges, and group-level summaries. Thatβs exactly what Pandas is for. π Table of Contents What is Pandas and Why Do You Need It? Installing and Importing Pandas The Two Core Data Structures Creating DataFrames Reading and Writing Data Exploring a DataFrame Selecting Data - loc, iloc, and Column Access Filtering Rows Adding, Modifying, and Dropping Columns Sorting Data Handling Missing Data String Operations Working with Dates and Times apply(), map(), and applymap() GroupBy - Aggregation and Split-Apply-Combine Merging and Joining DataFrames Pivot Tables and Crosstabs Reshaping - melt() and stack()/unstack() MultiIndex DataFrames Performance Tips Practice Questions What We Covered + Whatβs Next 1. What is Pandas and Why Do You Need It? NumPy arrays are powerful, but they have one limitation: every column must be the same data type, and there are no column names or row labels. ...

Python Collections - Practice Questions and Solutions List, Tuple, Dictionary, Set β Complete Practice Set This practice set covers strings and all four major Python collections. Questions are grouped by collection type, then by difficulty within each section. The final section has mixed questions that combine multiple collections, loops, and conditionals. Try each question before reading the solution. Table of Contents Part 1 β Lists Part 2 β Strings Part 3 β Tuples Part 4 β Dictionaries Part 5 β Sets Part 6 β Mixed Questions Quick Reference Part 1 β Lists A list is an ordered, mutable collection. It allows duplicate values and supports indexing, slicing, appending, and sorting. ...

Python Loops - Practice Questions and Solutions 20 Questions from Easy to Hard All 20 questions are based on the Loops Masterclass. Try each question on your own before reading the solution. The questions are ordered by difficulty: Easy (1-7), Medium (8-14), Hard (15-20). Table of Contents Easy Questions (1-7) Medium Questions (8-14) Hard Questions (15-20) Easy Questions (1-7) Q1 β Basic for Loop with range() Print all numbers from 1 to 30 that are divisible by both 3 and 5. ...

NumPy Masterclass - From Basics to Advanced Prerequisites: Python basics, lists, loops, functions Install: pip install numpy Import convention: import numpy as np Table of Contents What is NumPy and Why Use It? Creating Arrays Array Properties Indexing and Slicing Modifying Arrays Reshaping and Stacking Math Operations and Broadcasting Universal Functions (ufuncs) Aggregations and Statistics Sorting and Searching Boolean Operations and Masking Random Number Generation Linear Algebra Working with Files Performance Tips and Best Practices 1. What is NumPy and Why Use It? NumPy (Numerical Python) is the foundation of the entire Python data science stack. Pandas, Matplotlib, Scikit-learn, and TensorFlow all build on top of it. ...

Pandas Masterclass - From Basics to Advanced Prerequisites: Python basics, NumPy fundamentals Install: pip install pandas openpyxl xlrd Import convention: import pandas as pd Table of Contents What is Pandas and Why Use It? Series - The 1D Structure DataFrame - The 2D Structure Loading and Saving Data Exploring Your Data Selecting and Filtering Adding and Modifying Columns Sorting Cleaning Data - Handling Missing Values Cleaning Data - Duplicates and Types String Operations Datetime Operations Groupby and Aggregation Merging, Joining and Concatenating Pivot Tables and Reshaping Apply, Map and Lambda Functions Plotting with Pandas Performance Tips 1. What is Pandas and Why Use It? Pandas provides two core data structures - Series (1D) and DataFrame (2D) - that make working with labeled, tabular data as natural as working with a spreadsheet, but with the full power of Python. ...

Python Exception Handling A Complete Reference Guide Table of Contents The Big Picture What Are Exceptions? The Exception Hierarchy try / except - The Foundation else and finally Clauses Raising Exceptions Custom Exceptions Exception Chaining Context Managers and Exceptions Logging Exceptions Common Mistakes to Avoid Real-Life Patterns Practice Questions & Answers Quick Reference Cheat Sheet The Big Picture βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β EXCEPTION HANDLING FLOW β β β β try: β β ββ risky code runs here βββββββββββββββββββββββββββββββ β β β β β except SomeError: βββ exception caught here β β β ββ handle it ββ β β β βΌ β β except (TypeError, ValueError): βββ multiple types β β ββ handle them ββ β β β β except Exception as e: βββ catch with reference β β ββ inspect e ββ β β β β else: βββ runs ONLY if NO exception β β ββ success path ββ β β β β finally: βββ ALWAYS runs, no matter what β β ββ cleanup ββ β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Core Philosophy: Exceptions are not bugs - they are Pythonβs way of saying βsomething unexpected happened here, and Iβm passing control to whoever knows how to handle it.β ...

Working with Files in Python - The Complete Guide Everything you need to read, write, parse, and manage files like a professional Why Files Matter More Than You Think Every meaningful program eventually needs to talk to the outside world. Not through a web API or a database - just a plain file sitting on disk. Your data science pipeline reads a CSV. Your web scraper writes results to JSON. Your deployment script reads a config file. Your ETL job processes gigabytes of logs. ...

Lesson 2 - Filtering & Querying Data Theory + Practice | ShopDB - Indian E-commerce Dataset Before You Start Run setup.sql in pgAdmin to create and populate ShopDB. Verify you see 5 tables with the correct row counts. Then work through this file top to bottom. What youβll learn in this lesson: Concept What it does DISTINCT Remove duplicate values from results IN / NOT IN Match against a list of values BETWEEN Filter within a range LIKE / ILIKE Pattern matching on text IS NULL / IS NOT NULL Handle missing values CASE WHEN Conditional logic inside a query Date functions Filter and extract parts of dates COALESCE Replace NULL with a fallback value All queries in this lesson run on ShopDB. The dataset has: ...