Working with data often means juggling messy files, cleaning inconsistencies, and reshaping tables until they’re analysis-ready. That’s where Pandas shines it’s the backbone of data manipulation in Python. But with hundreds of methods and options, it can be overwhelming to remember them all.

This cheatsheet brings together the most essential Pandas methods, organized by category, with short explanations you can scan quickly. Whether you’re importing data, cleaning missing values, reshaping tables, or analyzing trends, this guide will help you find the right function fast without digging through endless documentation.
1. Data Creation & I/O
- pd.read_csv() – Load CSV file
- pd.read_excel() – Load Excel file
- pd.read_json() – Load JSON file
- pd.read_sql(query, con) – Load data from SQL
- pd.read_html() – Parse tables from HTML
- pd.read_clipboard() – Load data copied to clipboard
- df.to_csv() – Save DataFrame to CSV
- df.to_excel() – Save DataFrame to Excel
- df.to_json() – Save DataFrame to JSON
- df.to_sql() – Write DataFrame to SQL
- df.to_clipboard() – Copy DataFrame to clipboard
- df.to_markdown() – Export as Markdown table
- df.to_latex() – Export as LaTeX
- df.to_html() – Export as HTML
2. Inspection & Metadata
- df.head() – First rows
- df.tail() – Last rows
- df.info() – DataFrame summary
- df.describe() – Statistical summary
- df.dtypes – Column data types
- df.columns – Column labels
- df.index – Row index
- df.axes – Row and column labels
- df.shape – Dimensions of DataFrame
- df.memory_usage() – Memory usage per column
- df.size – Number of elements
- df.empty – Check if empty
3. Selection & Indexing
- df[“col”] – Select column
- df[[“col1″,”col2”]] – Select multiple columns
- df.loc[] – Select by label
- df.iloc[] – Select by position
- df.at[] – Fast scalar access (label)
- df.iat[] – Fast scalar access (position)
- df.where() – Conditional selection
- df.mask() – Replace based on condition
- df.query() – SQL-like queries
- df.take() – Select rows by index
4. Modifying Data
- df.assign() – Add or modify columns
- df.insert() – Insert new column
- df.update() – Update with another DataFrame
- df.drop() – Drop rows or columns
- df.rename() – Rename labels
- df.replace() – Replace values
- df.eval() – Evaluate string expressions
5. Handling Missing Data
- df.isna() – Detect missing values
- df.notna() – Opposite of isna
- df.fillna() – Fill missing values
- df.dropna() – Remove missing values
- df.interpolate() – Interpolate values
6. Sorting & Ranking
- df.sort_values() – Sort by column values
- df.sort_index() – Sort by index
- df.rank() – Rank elements
- df.nlargest() – Largest N values
- df.nsmallest() – Smallest N values
7. Aggregation & Statistics
- df.min(), df.max() – Minimum / maximum
- df.sum(), df.mean() – Sum / mean
- df.median() – Median
- df.mode() – Mode
- df.std(), df.var() – Standard deviation / variance
- df.count() – Count non-missing values
- df.cumsum(), df.cumprod() – Cumulative sum/product
- df.cummin(), df.cummax() – Cumulative min/max
- df.any(), df.all() – Boolean checks
8. Grouping & Window Functions
- df.groupby() – Group by column(s)
- df.agg() – Aggregate with functions
- df.transform() – Transform group values
- df.ngroup() – Number groups
- df.size() – Size of groups
- df.rolling() – Rolling window
- df.expanding() – Expanding window
9. String Methods (Series.str)
- str.upper(), str.lower() – Case conversion
- str.len() – String length
- str.strip() – Trim spaces
- str.split() – Split string
- str.get() – Extract element by index
- str.contains() – Check substring
- str.replace() – Replace text
- str.startswith(), str.endswith() – Start/end check
- str.extract() – Extract regex groups
10. Categorical Data
- astype(“category”) – Convert to category
- cat.categories – List categories
- cat.codes – Category codes
- cat.add_categories() – Add new category
- cat.remove_unused_categories() – Remove unused categories
11. Index & Reindexing
- df.set_index() – Set column as index
- df.reset_index() – Reset index
- df.reindex() – Conform to new index
- df.set_axis() – Rename axis labels
- df.swaplevel() – Swap MultiIndex levels
- df.sort_index() – Sort by index
- df.reorder_levels() – Reorder MultiIndex
12. MultiIndex & Hierarchical Data
- pd.MultiIndex.from_tuples() – Create MultiIndex
- df.xs() – Cross-section selection
- df.stack() – Pivot columns to rows
- df.unstack() – Pivot rows to columns
13. Time Series Methods
- pd.to_datetime() – Convert to datetime
- df[“Date”].dt.year – Extract year
- df[“Date”].dt.month – Extract month
- df[“Date”].dt.day – Extract day
- df[“Date”].dt.weekday – Day of week
- df[“Date”].dt.is_month_end – Month-end check
- df[“Date”].dt.is_leap_year – Leap year check
- df.resample() – Resample time series
- df.asfreq() – Change frequency
- df.shift() – Shift values
- df.diff() – Row differences
- df.pct_change() – Percentage change
14. Reshaping & Combining
- df.melt() – Unpivot columns to rows
- df.pivot() – Reshape table
- df.pivot_table() – Pivot with aggregation
- df.concat() – Concatenate DataFrames
- df.merge() – SQL-style merge
- df.join() – Join on index or key
- df.add(), df.sub(), df.mul(), df.div() – Arithmetic operations
- df.combine_first() – Fill NA from another DataFrame
15. Apply & Map
- df.apply() – Apply function along axis
- df.applymap() – Apply function element-wise
- df.map() – Map values in Series
16. Visualization
- df.plot() – Line plot
- df.plot.bar() – Bar plot
- df.plot.hist() – Histogram
- df.plot.box() – Boxplot
- df.plot.area() – Area plot
- df.plot.scatter() – Scatter plot
Conclusion
Pandas is vast, but you don’t need to memorize everything. Having a structured cheatsheet at your fingertips saves time, reduces friction, and lets you focus on the real task: extracting insights from your data.
This reference covered the most useful methods across I/O, selection, cleaning, grouping, reshaping, and visualization giving you a solid toolkit for nearly any workflow. Keep it open while you work, and over time you’ll find the commands becoming second nature.
With this guide, you’re better equipped to work faster, cleaner, and smarter with data in Python.
Related Reads
- 10 Best AI Engineering Books to Read in 2025
- Mastering GPT-5 Prompting: The Complete Guide to Smarter AI Outputs
- Mastering Context Engineering: 6 Proven Strategies to Make AI Agents Smarter and More Reliable
- LangChain vs LlamaIndex: Powerful Retrieval-Augmented Generation Tools Compared
- 20+ Mind-Blowing LLM Apps You Can Build Today – From AI Agents to RAG Pipeline
3 thoughts on “Pandas Cheatsheet: The Ultimate Guide for Data Analysis in Python”