#1 India's Top IT Training Institute

On Demand Courses

9 programs

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →

Python Pandas for Data Analysis
PDF Downloads

Download the pandas data analysis guide PDF from Uncodemy: load, clean, group, merge and summarise data with runnable examples.

Prepared by: Uncodemy trainer team Reviewed by: Uncodemy Last reviewed: 27 Oct 2026
What the Guide Covers
1
DataFrames and SeriesA table of columns sharing one index.
2
Select and filterConditions with & and |, plus new columns.
3
Groupby and datesSummarise by city, month or category.
4
Merge and pivotCombine tables safely with validate.
5
Fix common errorsKeyError, SettingWithCopy and merge surprises.

Quick Answer

This page offers Uncodemy's pandas data analysis guide as a PDF download. Pandas is the main Python library for working with tables of data. The guide explains DataFrames and Series, selecting and filtering, groupby aggregation, merging, working with dates, pivot tables and the errors that trip up beginners. Every example uses a small table built in the code so you can run it as is.

Download

Python Pandas for Data Analysis PDF

Download the guide below. Each download is its own file, and everything in it is also explained on this page.

1 PDF Available
PDF 01 Main Guide

Python Pandas for Data Analysis

DataFrames and Series, selecting and filtering, groupby aggregation, merging, dates, pivot tables and common errors, with runnable examples on a small orders dataset.

PDF Free Oct 2026
Download PDF

A short form asks for your details before the download starts. Your details are used only to share study material and course information.

01

What pandas gives you

Pandas provides two main structures. A Series is a single labelled column of values. A DataFrame is a table of columns, each a Series, sharing the same row index. Together with a large set of methods they let you load files, select and filter rows, create new columns, group and summarise, combine tables, reshape data and work with dates and text.

For analysts, pandas is the bridge between a spreadsheet and a full programming language: the ideas are familiar from Excel and SQL, but the work is repeatable and scales to bigger files. The examples below build their own small dataset so that nothing external is needed.

02

Creating a DataFrame and a first look

A small orders table built in code, with typical inspection methods.

import pandas as pd

orders = pd.DataFrame({
    "order_id": [1, 2, 3, 4, 5, 6],
    "city": ["Delhi", "Noida", "Delhi", "Pune", "Noida", "Delhi"],
    "status": ["done", "done", "cancelled", "done", "done", "done"],
    "amount": [500, 320, 150, 800, 260, 410],
    "order_date": pd.to_datetime(["2026-08-03", "2026-08-15", "2026-08-20",
                                  "2026-09-02", "2026-09-10", "2026-09-18"]),
})

print(orders.shape)
print(orders.dtypes)
print(orders.head(3))
print(orders.describe())
03

Selecting, filtering and new columns

Select columns, filter with conditions and create a calculated column. Combine conditions with & and | and put each in brackets.

done = orders[(orders["status"] == "done") & (orders["amount"] > 300)]
print(done[["order_id", "city", "amount"]])

orders["amount_with_gst"] = (orders["amount"] * 1.18).round(2)
orders["size"] = pd.cut(orders["amount"], bins=[0, 300, 600, 10_000],
                        labels=["small", "medium", "large"])
print(orders[["order_id", "amount", "size"]])
04

SQL and pandas side by side

If you already know SQL, most pandas operations will feel familiar.

IdeaSQLpandas
Choose columnsSELECT a, bdf[['a', 'b']]
Filter rowsWHERE x > 5df[df['x'] > 5]
Group and totalGROUP BY c, SUM(x)df.groupby('c')['x'].sum()
SortORDER BY x DESCdf.sort_values('x', ascending=False)
JoinJOIN ... ONdf.merge(other, on='key')
Distinct countCOUNT(DISTINCT x)df['x'].nunique()
05

Groupby: summarising by category

Named aggregation produces clearly labelled result columns.

summary = (orders[orders["status"] == "done"]
           .groupby("city")
           .agg(orders=("order_id", "count"),
                revenue=("amount", "sum"),
                avg_order=("amount", "mean"))
           .round(1)
           .sort_values("revenue", ascending=False))
print(summary)
06

Working with dates

Extract the month, group by it and compute the monthly total. Resampling is another option for a date index.

orders["month"] = orders["order_date"].dt.to_period("M")

monthly = (orders[orders["status"] == "done"]
           .groupby("month")["amount"].sum()
           .reset_index())
monthly["change_pct"] = (monthly["amount"].pct_change() * 100).round(1)
print(monthly)
07

Merging and pivoting

Add a city manager from a second table and build a pivot table of revenue by city and month. Use validate to catch unexpected duplicate keys.

managers = pd.DataFrame({"city": ["Delhi", "Noida", "Pune"],
                         "manager": ["Asha", "Ravi", "Meera"]})

merged = orders.merge(managers, on="city", how="left", validate="many_to_one")
print(len(orders), len(merged))   # row count should not change

pivot = pd.pivot_table(merged[merged["status"] == "done"],
                       index="city", columns="month",
                       values="amount", aggfunc="sum", fill_value=0)
print(pivot)
08

Habits for reliable pandas work

  • Check shape and dtypes right after loading.
  • Parse dates when reading the file instead of fixing them later.
  • Use brackets around each condition and use & and |, not and and or.
  • Compare row counts before and after merges.
  • Prefer vectorised operations over loops over rows.
  • Chain steps in a readable way and print intermediate results while you learn.
09

Common errors and their usual causes

Message or symptomLikely causeFix
KeyError: columnMisspelled or padded column namePrint df.columns; strip spaces
ValueError: ambiguous truth valueUsed and or or instead of & and |Use & and | with brackets
SettingWithCopyWarningAssigning to a sliceUse .copy() or .loc
Row count grows after mergeDuplicate keys on the right sideUse validate and deduplicate
Dates as object dtypeNot parsedUse pd.to_datetime
10

Where to go next

Once these operations feel natural, learn reshaping with melt and pivot, string methods for cleaning, window-style operations with rolling and shift and plotting directly from DataFrames.

Practise by taking a real CSV file and answering five business questions with code, then compare your answers with the same questions solved in SQL.

11

Thinking in columns, not loops

The biggest change when moving from a spreadsheet or a programming loop to pandas is to think about whole columns at once. To add GST to every amount you do not visit each row; you multiply the column. To flag large orders you compare the whole column with a number and get a True or False value for every row. To total revenue by city you group and sum.

This column-first thinking makes code shorter and faster, and it matches how SQL works. When you catch yourself writing a for loop over rows, stop and ask whether a column operation, a groupby or a merge would do the same job.

12

A practice routine for pandas

WeekFocusExercise
1Loading, inspecting, selectingLoad a CSV and answer five questions using filters
2Groupby and aggregationSummarise revenue by category and month
3Merge and reshapeCombine two tables and build a pivot table
4Dates and cleaningParse dates, handle missing values and write a short report

Learn with a trainer

Want to use pandas the way analysts do at work? Explore Uncodemy's Data Analytics course and learn from industry trainers.

View Course
About these PDFs: These PDFs are study material for learning and revision. They are not a certificate, a degree or a promise of a job, and technology changes, so check official documentation for the latest details. Spot an error? Write to info@uncodemy.com and the trainer team will review it.
FAQ

Frequently Asked Questions

What is pandas used for?
Pandas is a Python library for working with tabular data: loading, cleaning, filtering, grouping, merging, reshaping and summarising.
What is the difference between a Series and a DataFrame?
A Series is a single labelled column of values, while a DataFrame is a table made of several Series sharing one index.
How do I filter rows in pandas?
Use a boolean condition inside square brackets, such as df[df['amount'] > 300], and combine conditions with & and | in brackets.
How do I avoid wrong results when merging?
Use the validate argument, compare row counts before and after and check for unmatched keys.
Is pandas similar to SQL?
Many ideas map directly: select, where, group by, join and order by all have pandas equivalents.
Are these PDFs free to download?
Yes, the pandas data analysis guide PDF is free. A short form asks for your details before the download starts.