learn about numpy library

Numpy Masterclass - Beginner to Advanced

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. ...

March 18, 2026 · 19 min · 3867 words · By codeverra
learn about pandas library

Pandas Masterclass - Beginner to Advanced

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. ...

March 18, 2026 · 20 min · 4166 words · By codeverra
Exception handling in python

Exception Handling in Python - Complete Guide

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.” ...

March 17, 2026 · 20 min · 4145 words · By codeverra
file handling in python

File Handling in Python - Complete Guide

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. ...

March 17, 2026 · 31 min · 6439 words · By codeverra
file handling in python

Functions in Python - Complete Guide

Python Functions Masterclass A Complete Guide from Basics to Advanced Concepts Who is this for? You know Python basics and have some experience with loops and collections. This guide covers every important concept around functions in Python – from defining your first function all the way through decorators and closures. Every concept is explained with a simple example first. Table of Contents What is a Function and Why Use One? Defining and Calling Functions Parameters and Arguments Default Parameters *args – Variable Positional Arguments **kwargs – Variable Keyword Arguments Combining All Argument Types Return Values Scope and the LEGB Rule global and nonlocal Keywords Docstrings and Function Annotations Lambda Functions Higher Order Functions map(), filter(), and reduce() Closures Decorators Decorators with Arguments Chaining Multiple Decorators Recursion Generator Functions and yield Practice Questions Solutions What We Covered and What is Next 1. What is a Function and Why Use One? Imagine you need to calculate GST on product prices in three different parts of your program. Without a function, you write the same calculation three times. If the GST rate changes, you update it in three places – and likely miss one. ...

March 17, 2026 · 35 min · 7283 words · By codeverra
higher order functions and decorators in python

Higher Order Functions and Decorators in Python

Python Higher-Order Functions & Decorators A Complete Reference Guide Table of Contents The Big Picture Functions as First-Class Objects Higher-Order Functions Closures - The Foundation of Decorators Decorators - Core Concept The @ Syntax Preserving Metadata with functools.wraps Decorators with Arguments Class-Based Decorators Stacking Multiple Decorators Built-in Decorators Practical Decorator Patterns Common Mistakes to Avoid Practice Questions & Answers Quick Reference Cheat Sheet The Big Picture ┌─────────────────────────────────────────────────────────────────────┐ │ THE DECORATOR MENTAL MODEL │ │ │ │ A decorator is a function that WRAPS another function │ │ to add behaviour before, after, or around it. │ │ │ │ Original Function │ │ ┌────────────────┐ │ │ │ do_thing() │ │ │ └────────────────┘ │ │ │ decorator applied │ │ ▼ │ │ ┌────────────────────────────────────┐ │ │ │ wrapper() │ │ │ │ ┌──────────────────────────────┐ │ │ │ │ │ before logic (logging etc) │ │ │ │ │ ├──────────────────────────────┤ │ │ │ │ │ do_thing() ← called │ │ │ │ │ ├──────────────────────────────┤ │ │ │ │ │ after logic (timing etc) │ │ │ │ │ └──────────────────────────────┘ │ │ │ └────────────────────────────────────┘ │ │ │ │ @decorator is sugar for: func = decorator(func) │ └─────────────────────────────────────────────────────────────────────┘ Core Idea: A decorator is just a callable that takes a function and returns a new callable. Everything else - the @ syntax, functools.wraps, parameterised decorators - builds on top of this single idea. ...

March 17, 2026 · 22 min · 4597 words · By codeverra
iterators and generators in python

Iterators and Generators in Python - Complete Guide

Python Iterables, Iterators & Generators A Complete Lesson Plan & Reference Guide Table of Contents The Big Picture Iterables Iterators The Iterator Protocol Building Custom Iterators Generators Generator Expressions Advanced Generator Features Common Pitfalls & Things to Keep in Mind Real-Life Applications Practice Questions & Answers Quick Reference Cheat Sheet The Big Picture Before diving in, here’s the conceptual map you need to hold in your head: ┌──────────────────────────────────────────────────┐ │ ITERABLE │ │ Any object you can loop over with a for loop │ │ Examples: list, tuple, str, dict, set, file │ │ │ │ Has __iter__() → returns an Iterator │ └──────────────────────┬───────────────────────────┘ │ __iter__() called ▼ ┌──────────────────────────────────────────────────┐ │ ITERATOR │ │ An object that knows where it is in a sequence │ │ and can produce the next value on demand │ │ │ │ Has __iter__() → returns self │ │ Has __next__() → returns next value or raises │ │ StopIteration │ └──────────────────────┬───────────────────────────┘ │ special case of ▼ ┌──────────────────────────────────────────────────┐ │ GENERATOR │ │ A convenient way to create iterators using │ │ the `yield` keyword - Python auto-builds the │ │ iterator protocol for you │ └──────────────────────────────────────────────────┘ Key Insight: Every iterator is an iterable, but not every iterable is an iterator. A list is an iterable but NOT an iterator. iter(list) gives you an iterator. ...

March 17, 2026 · 20 min · 4112 words · By codeverra
itertools module in python

Itertools Module in Python - Complete Guide

Python’s itertools - The Missing Manual A deep dive into one of Python’s most underused standard library modules Wait, Why Should I Care About Another Module? You’ve written Python for a while. You know how to use for loops, list comprehensions, zip, and enumerate. Things work. So when someone says “hey, you should learn itertools”, it’s easy to nod politely and move on. Here’s what changes your mind. Imagine you’re asked to generate all possible batting orders for 4 players chosen from a squad of 11. Or you need to group a massive log file by date without loading it all into memory. Or you want to pair up every possible combination of feature columns for a machine learning experiment. ...

March 17, 2026 · 29 min · 6049 words · By codeverra
pandas practice on IPL dataset

Practice Pandas on IPL Dataset

Pandas Practice Sheet - IPL Dataset A complete two-table exploration: from match summaries to ball-by-ball intelligence Why IPL Is the Best Dataset for Pandas After Zomato The Zomato dataset taught you how to clean a single messy table. The IPL dataset teaches you something more important: how to work with two related tables and merge them to answer questions neither table can answer alone. This is how data exists in every real company - not as one giant flat file, but as a set of related tables that you must join, aggregate across levels, and reason about carefully. ...

March 17, 2026 · 38 min · 8014 words · By codeverra