Skip to main content
MahiDev — Learn. Build. Become AI-ready.

Module 24

pandas

Load, clean, filter, group, and combine table-shaped data with pandas Series and DataFrames.

Intermediate9 hours 10 min22 lessons

01

What Is pandas

Meet pandas, the labelled data library built on NumPy, and its two types: the one-dimensional Series and the two-dimensional DataFrame.

Intermediate25 min

02

Creating a Series

Build a Series from a list, a dict, an ndarray, or a single value, and set your own index, dtype, and name while you do it.

Intermediate25 min

03

Series Attributes

Inspect a Series with index, values, dtype, size, shape, ndim, name, and empty, and take a quick look with head and tail.

Intermediate25 min

04

Getting and Setting Series Values

Read Series values by label with loc and by position with iloc, slice both ways, pass lists of labels, and assign new values back.

Intermediate25 min

05

Series Statistics

Summarize a Series with sum, mean, median, std, min and max, describe, value_counts, unique, nunique, nlargest, and cumulative totals.

Intermediate25 min

06

Creating a DataFrame

Build a DataFrame from a dict of columns, a list of rows, a list of dicts, or a dict of Series, and set the index and column order yourself.

Intermediate25 min

07

DataFrame Attributes

Read the shape of a table with shape, size, index, columns, axes and dtypes, then look inside with head, tail, info, and describe.

Intermediate25 min

08

Selecting Columns and Rows

Pull one column or several out of a DataFrame with square brackets, slice rows by position, and learn why chained selection is a poor place to assign.

Intermediate25 min

09

loc and iloc

Select any corner of a DataFrame by label with loc or by position with iloc, and keep the two slicing rules straight in your head.

Intermediate25 min

10

Filtering Rows

Keep the rows you care about with a condition, combine conditions with and and or, and match against a list of values with isin and between.

Intermediate25 min

11

Adding Columns and Rows

Grow a DataFrame: build a new column from a value or an expression, place one at a chosen position, and append rows with loc or concat.

Intermediate25 min

12

Updating Values

Change what is already in a DataFrame: one cell, a whole column, or only the rows that match a condition, with loc, where, mask, and replace.

Intermediate25 min

13

Removing Columns and Rows

Drop columns and rows you do not need, decide between a copy and an in-place change, and find and remove duplicate records.

Intermediate25 min

14

Sorting Data

Order a Series or a DataFrame by its values or by its index, sort on several columns at once, and grab the top rows with nlargest.

Intermediate25 min

15

Column Types and astype

Read the dtype of every column, convert one or several of them with astype, and handle the text that will not turn into a number.

Intermediate25 min

16

Working with Missing Data

Find the gaps in a table with isna, fill them with a sensible value or the value next door, and drop the rows or columns that are too empty to use.

Intermediate25 min

17

Iterating Rows and Columns

Walk a DataFrame row by row with iterrows and itertuples, loop over its columns, and know why whole-column work is usually the better answer.

Intermediate25 min

18

Grouping with groupby

Split a table into groups on one or more columns, then count, total, and average each group with the split, apply, combine pattern.

Intermediate25 min

19

agg, transform, and filter

Ask for several summaries at once with agg, spread a group result back over its rows with transform, and keep whole groups with filter.

Intermediate25 min

20

Combining DataFrames

Stack tables with concat and match them up on a shared column with merge, choosing inner, left, or outer to decide which rows survive.

Intermediate25 min

21

Reading and Writing Files

Load a CSV into a DataFrame, control the separator, header, and index, and write your result back out as CSV, text, or JSON.

Intermediate25 min

22

Exploring a Dataset

Put the module together: load a small dataset, check its shape and gaps, fix the types, then answer real questions with filters and groups.

Intermediate25 min