Turn raw data into answers with Python and AI
Load it, clean it, analyze it, and show what it means
Real Python takes you from your first DataFrame to confident analysis with pandas, Polars, NumPy, and Matplotlib. Follow a guided path, practice on real datasets, and get help the moment you’re stuck.
import pandas as pd df = pd.read_csv("recent-grads.csv") df[["Major", "Major_category", "Total"]].head(3)
| Major | Major_category | Total | |
|---|---|---|---|
| 0 | Petroleum Eng. | Engineering | 2339 |
| 1 | Mining & Mineral Eng. | Engineering | 756 |
| 2 | Metallurgical Eng. | Engineering | 856 |
(df.groupby("Major_category")["Total"] .sum().nlargest(5) .plot.barh()) # Where do graduates go?
- 90+data science tutorials
- 40+video courses
- 40+interactive quizzes
- 60+coding exercises
- 5guided learning paths
The whole analysis workflow, one skill at a time
Data work follows the same arc whether you’re digging into sales numbers, survey results, or sensor logs. Real Python covers each step with hands-on material built around real datasets.
Collect and load
Read CSV, JSON, Excel, and SQL data into DataFrames, and query local files directly with DuckDB.
Clean and reshape
Handle missing values, fix messy columns, and merge, sort, and pivot datasets until they’re ready to trust.
Analyze
Group and aggregate, compute descriptive statistics and correlations, and fit your first regression models.
Visualize and share
Build clear charts, interactive dashboards, and maps, and present your work in reproducible notebooks.
A clear path from first DataFrame to real analysis
Not sure where to start? Work through these learning paths in order. Each one mixes tutorials, video courses, quizzes, and exercises, and tracks your progress as you go.
-
1
Data Science With Python Core Skills
Set up Jupyter, load CSV and JSON data into pandas, clean and group it, then plot and analyze it with Matplotlib and NumPy.
-
2
pandas for Data Science
Go deeper on DataFrames: indexing, GroupBy, merging, sorting, pivot tables, and the performance tips that keep big analyses fast.
-
3
Data Visualization With Python
Tell the story in your data with Matplotlib, Seaborn, Bokeh, Dash, and Folium, from quick plots to interactive dashboards and maps.
-
4
Math for Data Science
Build the statistical foundations: descriptive statistics, correlation, linear and logistic regression, and gradient descent.
-
Data Collection & Storage
Bring in data from files, Excel, SQL databases, and the cloud, and store your results so others can use them.
Ready for what comes next? Continue with Machine Learning With Python. New to Python itself? Start with Python Basics first.
Rank college majors by popularity
This is a real exercise from the Plot With pandas video course, using the same dataset as the notebook above. Write your function in the editor and click Run Tests.
Running tests, hints, and solutions are included with a Real Python membership. Not a member yet? You can still read the task and write your solution before you join.
Read it, watch it, test it, practice it
Every data science topic comes in the formats that help it stick. Mix them however you like.
Tutorials
In-depth, example-driven guides to pandas, Polars, NumPy, plotting, statistics, and more.
Browse tutorials →Video courses
Follow along as an instructor works through a real dataset, one bite-sized lesson at a time.
Start with Introduction to pandas →Quizzes
Check what you’ve learned in a few minutes and see exactly which concepts to review.
Test your core skills →Coding exercises
Write real pandas, Polars, and NumPy code in your browser and get instant test feedback.
How exercises work →Stuck on a groupby? Ask right where you are
Data code fails in confusing ways: a KeyError from a column name with a stray space, a SettingWithCopyWarning, a result that’s a DataFrame when you expected a Series.
Mentor AI sees the tutorial, lesson, or exercise you’re on and your code, and nudges you toward the fix one hint at a time, so you understand what pandas is actually doing.
Meet Mentor AI →df.groupby("Major_category")[["Total"]].sum() gives me a DataFrame. Why?You’re really close! Look at the brackets around "Total". You’re passing a list of column names, and pandas keeps a list of columns as a DataFrame, even when the list has only one item.
What happens if you select the column with a single string instead?
["Total"] instead of [["Total"]]. Now it’s a Series!Exactly. Now the only failing test is about order. Which method could sort those totals from largest to smallest?
Learn the tools data teams actually use
From long-standing staples to newer tools that are changing how Python developers work with data.
New and updated for 2026
The Real Python team keeps publishing and refreshing data science content, so what you learn matches the tools and versions you’ll use at work.
See all data science content →- TutorialPython Statistics Fundamentals: How to Describe Your Data
- CourseAutomating EDA With fg-data-profiling
- TutorialValidating Data With Pointblank in Python
- TutorialPython for Data Analysis: A Practical Guide
- TutorialAltair: Declarative Charts With Python
- QuizPython Statistics Fundamentals
- CourseIntroduction to pandas
Questions and answers
Do I need to know Python before I start?
You should be comfortable with Python basics like variables, lists, loops, and functions. If you’re not there yet, the Python Basics learning path gets you ready, and you can switch to data science as soon as you finish it.
Do I need a strong math background?
No. You can load, clean, analyze, and visualize data with very little math. When you want to go further, the Math for Data Science path explains statistics and regression with Python code rather than proofs.
Should I learn pandas or Polars?
Start with pandas. It’s the most widely used DataFrame library, and most examples and job postings assume it. Once you’re comfortable, Polars is a great addition for larger datasets. Our Polars vs pandas tutorial walks through the differences.
Is this the same as machine learning?
Not quite. Data science and analytics are about understanding data and communicating what it shows. Machine learning builds on those skills to train models that make predictions. When you’re ready for that step, continue with Machine Learning With Python.
What’s included in a membership?
Every Real Python membership includes all video courses, quizzes, coding exercises, and learning paths for data science and every other topic, along with Mentor AI as it rolls out.
Start making sense of your data
Get your free learning plan and follow the full data science roadmap, with courses, quizzes, coding exercises, and a mentor at your side.