Skip to content
Cheat sheets/Pandas essentials

Pandas essentials

From raw CSV to real answer in minutes — with the operations you'll use every single day.

Load, inspect, clean and reshape DataFrames

8 MIN21 ENTRIES4 GROUPSUPDATED 2026-11-18

What you'll take away

Load and understand any dataset in a few lines

Clean missing and inconsistent values with confidence

Reshape, group and join data without guesswork

21 entries · click a command to copy

01

Load and inspect

Load a CSV into a DataFrame.

e.g. df = pd.read_csv('sales.csv')

Preview the first or last five rows.

Get (rows, columns) as a tuple.

Show column names, data types and non-null counts.

Summarise numeric columns with count, mean, spread and quartiles.

02

Select and filter

Select one column as a Series.

Select several columns as a DataFrame.

Select by label — use df.loc[df.age > 30] for a boolean filter.

Select by integer position.

Filter rows with a readable expression.

e.g. df.query('age > 30 and city == "Pune"')

03

Clean data

Remove rows containing missing values.

Tip: Use subset=['col'] to drop only where a specific column is missing.

Replace missing values with a chosen value or method.

Remove a column.

Rename columns without mutating the original by default.

Move the index into a regular column.

04

Transform and aggregate

Sort rows by one or more columns.

Summarise each group with one or more functions.

Compute a single-column statistic.

Count frequencies of values in a Series.

Join two DataFrames on a shared key.

Create a derived column with vectorised arithmetic.

§ CREDITSource and curation

This sheet was curated from reference material in the Skyware AI technical library (Pandas essential commands cheatsheet (Gina Acosta)). Command syntax is factual; explanations, grouping and examples were written by our engineering team. Always verify syntax against your tool or database version.