Python for Data Science: A Beginner’s Roadmap to Your First Analysis

Python for Data Science: A Beginner’s Roadmap to Your First Analysis

Learn Python for data science in 8 weeks. Pick up pandas, clean messy real-world data, run your first analysis, and publish a portfolio project employers notice.

POSTED ON OCTOBER 25, 2026

Picture your first hour with real data. You finish a Python course, open a city dataset, run df.describe(), and watch pandas skip the price column entirely. Every value turns out to be text: dollar signs, stray commas, and a few cells that just say “call for quote.”

Courses teach syntax on spotless examples. Real work starts with a messy file and a question someone wants answered by Friday. Python programming for data science means learning to bridge the two.

This roadmap closes the gap in four two-week phases. Each phase ends with a checkpoint, and the last one leaves you with a published project you can show an employer. Plan on 7 to 10 hours a week. And if you’re short on time, stretch each phase to three weeks and keep the order.

Why Python Leads Data Science

Python is the default language of data work, and its lead keeps growing. In Stack Overflow’s 2025 Developer Survey, Python usage jumped 7 percentage points in a single year to about 58% of developers. For a mature language, that kind of jump is rare.

Employers keep hiring for these skills, too. The U.S. Bureau of Labor Statistics projects data scientist employment to grow 34% from 2024 to 2034, with roughly 23,400 openings a year and a median wage of $112,590 in May 2024. The average for all occupations is about 3%.

Three things keep Python on top:

  • One language for the whole pipeline. You can pull data, clean it, chart it, model it, and ship it without switching tools.
  • A huge free toolbox. The Python Package Index holds hundreds of thousands of free packages, so someone has likely solved your problem already.
  • Readable syntax. Python reads close to plain English, which matters when a colleague (or you, six months later) has to follow an analysis.

Academic statisticians still favor R, and analysts still use SQL to pull data out of databases. Data science with Python handles everything in between.

Two Traps to Avoid Before You Start

If you spend time in Python learning communities, you’ll see the same two stories again and again:

1. Tutorial hell. You watch an instructor clean a dataset, nod along, and copy the code. It runs. You feel productive. Then you open a new file on your own and freeze, because you replicated the steps without learning why each one happened. The fix: after every lesson, apply the same technique to a different dataset. Break the code on purpose and read the error.

2. Jumping to machine learning. Gradient boosting and neural networks look great on a resume. If you train a model on dirty or leaky data and it still produces garbage, just with more decimal places. Working analysts spend most of their time loading, cleaning, and checking data. Build that muscle first. You’ll reach modeling later and move faster because of it.

Weeks 1 to 2: Python Fundamentals

You need less Python than most courses suggest. Python for data science needs only a short list of fundamentals:

Learn nowPostpone
Data types: integers, floats, strings, BooleansInheritance and polymorphism
Lists, dictionaries, tuples, setsMetaclasses and decorators
if / elif / else, for loopsAlgorithm puzzles and interview drills
Functions that take inputs and return valuesAsync programming
List and dictionary comprehensionsBuilding packages and CLIs
f-strings, reading files, reading error messagesDesign patterns

The right column can wait. Pandas works on one column at a time, so deep object-oriented code adds little to your first projects.

Spend extra time on dictionaries. One row of a CSV file works like a dictionary, and a list of them works like a table.

Practice in Colab

Try things out in Google Colab. It runs Jupyter notebooks in your browser and already includes pandas, NumPy, and the chart tools, so you skip setup entirely. The catch: files vanish when a session ends, and idle sessions shut down. Save copies of anything you need, and keep private data out.

Checkpoint

Write this kind of script without looking anything up:

import csv

with open("sales.csv") as f:
    rows = list(csv.DictReader(f))

amounts = [float(r["amount"]) for r in rows if r["amount"]]

print(f"Orders: {len(amounts)}")
print(f"Average: {sum(amounts) / len(amounts):.2f}")
print(f"Largest: {max(amounts):.2f}")

No libraries, no shortcuts. Just load the rows, skip the blanks, and sum things up. Every pandas operation in the next phase does a faster, safer version of this.

Weeks 3 to 4: The Core Python Libraries for Data Science

Almost every beginner project uses the same four libraries. Learn a small set of functions in each and skip the rest of the docs for now.

LibraryIts jobLearn these firstHabit to avoid
NumPyFast math on arraysSlicing, Boolean masks, vectorized arithmetic, np.nanLooping over arrays element by element
pandasLoading, cleaning, and summarizing tablesread_csv, info, describe, .loc, groupby, dropna, drop_duplicates, assignfor loops and iterrows() over rows
MatplotlibFigure layout and exportplt.subplots, titles, axis labels, tight_layout, savefigHand-building statistical charts Seaborn makes in one line
SeabornStatistical charts from DataFrameshistplot, boxplot, countplot, scatterplot, heatmapShipping default charts with no units or titles

Working on whole columns at once pays off fast: shorter code, fewer bugs, and speedups that can reach 100x on large tables. Analysts call that habit vectorization, and learning it marks the biggest shift from plain Python to pandas.

Heads up: pandas 3.0 changed things

Pandas 3.0 launched in early 2026, its first major release in about three years. Two changes will trip up anyone following older tutorials:

  • Text columns now get their own str type instead of the old catch-all object type. If a tutorial shows dtype: object for a name column, you’ll see str instead.
  • Copy-on-Write is now the only mode. Any filtered result acts like a copy, so the dreaded SettingWithCopyWarning is gone. Chained assignments such as df[df["x"] > 0]["y"] = 1 now silently change nothing. Use df.loc[df["x"] > 0, "y"] = 1 instead.

Pandas 3.0 also needs Python 3.11 or newer, so check your version first.

Scikit-learn, PyTorch, TensorFlow, and Spark show up on most “must-learn” lists. Scikit-learn is your next step after this roadmap; deep learning frameworks and Spark come much later.

Checkpoint

Finish LeetCode’s 30 Days of Pandas study plan or solve 15 data-wrangling problems on StrataScratch. Both force you to filter, join, and aggregate without loops.

Weeks 5 to 6: Your First Exploratory Analysis

In this phase, you turn syntax into analysis. You’ll set up your own computer and run a full exploratory data analysis (EDA) on a practice dataset, from first question to final answer.

Move to a local workspace

Install VS Code with its Python and Jupyter extensions. You keep the notebook feel and gain folders, Git, error checks, and an easy way to turn .ipynb notebooks into reusable .py scripts. Give each project its own environment with Astral’s uv, which installs packages in seconds and pins exact versions, so the project still runs next year:

uv init penguins-eda
cd penguins-eda
uv add pandas seaborn jupyter

Python’s built-in venv works too. Anaconda works if you’d rather click through an installer, but it takes far more disk space and installs packages slowly.

Start with a practice dataset

Palmer Penguins is a strong practice dataset. Dr. Kristen Gorman collected it at Palmer Station, Antarctica: 344 penguins across three species, with bill length, bill depth, flipper length, body mass, island, and sex. It has real missing values and overlapping groups, so you have to think instead of just running code. The walkthrough below uses it.

Run the analysis in five steps

Step 1: Write your questions before any code. Open the notebook with a Markdown cell listing three or four questions. Without them, you’ll make 40 charts and learn nothing. For penguins:

  1. How does body mass differ across species?
  2. Are bill length and bill depth related?
  3. Where is data missing, and does it matter?
  4. Does island tell us anything once we know the species?

Step 2: Load the data and inspect its structure. Seaborn includes Palmer Penguins, so you can load it in one line:

import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

df = sns.load_dataset("penguins")

print(df.shape)                 # (344, 7)
df.info()                       # column types and non-null counts
df.describe(include="all")      # ranges, means, top categories
df.isna().sum()                 # missing values per column

Read every line of that output. info() flags text that should be dates or numbers. describe() shows impossible values, such as a negative age or a 9,000 kg penguin.

Step 3: Clean what you found. Penguins has two rows with no measurements at all and a few more missing only sex. Each needs its own fix:

print(df.duplicated().sum())    # check for exact duplicate rows

df = (
    df.dropna(subset=["bill_length_mm"])              # rows with no measurements
      .assign(sex=lambda d: d["sex"].fillna("unknown"))
)

Dropping rows works when they’re a tiny share of the data. When you need to fill gaps in a numeric column, prefer the median over the mean, because one extreme value can drag the mean far off course.

Next, check for outliers with the interquartile range (IQR). Flag anything below Q1 minus 1.5 times the IQR, or above Q3 plus 1.5 times the IQR:

q1, q3 = df["body_mass_g"].quantile([0.25, 0.75])
iqr = q3 - q1
flagged = df[(df["body_mass_g"] < q1 - 1.5 * iqr) |
             (df["body_mass_g"] > q3 + 1.5 * iqr)]

A flag means “look closer,” not “delete.” An outlier might be a typo, or it might be the most interesting row in the file.

Real-world files need more work here. Expect to fix date text with pd.to_datetime(), strip currency signs before turning text into numbers, and trim stray spaces that make “Brooklyn” and “Brooklyn ” into two boroughs.

Step 4: Explore one, two, then many variables. Start with single variables, then compare pairs:

fig, axes = plt.subplots(1, 2, figsize=(11, 4))
sns.histplot(data=df, x="body_mass_g", hue="species", ax=axes[0])
sns.boxplot(data=df, x="species", y="body_mass_g", ax=axes[1])
axes[0].set_title("Body mass distribution (g)")
axes[1].set_title("Body mass by species (g)")
plt.tight_layout()

df.groupby("species")["body_mass_g"].agg(["mean", "median", "count"])

Gentoos clearly outweigh the other two species. Now the fun part. Plot bill length against bill depth for all penguins together, and the relationship slopes slightly downward. Longer bills, shallower bills? Color the points by species:

sns.scatterplot(data=df, x="bill_length_mm", y="bill_depth_mm", hue="species")

The trend flips. Within each species, longer bills go with deeper bills. The overall downward slope came from mixing three groups with different starting points. Statisticians call this Simpson’s paradox, and you just found it in your first notebook. That’s the kind of finding a portfolio project should aim for.

Finish with a heatmap to check every pair of number columns at once:

sns.heatmap(df.corr(numeric_only=True), annot=True, cmap="vlag")

Step 5: Write up what you learned. Under every chart, add a Markdown cell with one or two sentences: what the chart shows and which question it answers. End the notebook with a short summary of the main findings, the data’s limits (a few hundred penguins from three islands over three seasons), and what you’d investigate next.

Checkpoint

A penguins notebook that runs all five steps, handles the missing values, checks for outliers, and answers your four questions in plain language.

Weeks 7 to 8: Build and Publish Your Portfolio Project

Now use everything on a dataset you pick, and publish the result. Many learners quit here. Finish this phase and your project stands out.

Pick a portfolio dataset

Hiring managers judge your project partly by its dataset, so skip the classic three:

  • Titanic is fine for practice, but recruiters have seen thousands of survival-rate notebooks. It signals “I followed a course.”
  • Iris has 150 rows, no missing values, and neatly separated classes. Real data never looks like that.
  • Boston Housing no longer ships with scikit-learn. The maintainers removed it because one variable encoded the racial makeup of neighborhoods. Using it now raises eyebrows for the wrong reason.

Choose something messier:

DatasetSizeWhat it teaches
NYC Airbnb listings~48,000 rowsPrice outliers, location data, text fields
City 311 service requests100,000+ rowsTimestamps, dirty text, lots of missing values
Restaurant health inspectionsHundreds of thousands of rowsRepeat rows per business, messy categories, date fixes

Where to find free datasets:

The best first data analysis project for beginners pairs a dataset you can handle with a question you actually care about. Curiosity carries you through the dull cleaning parts.

Run the analysis, then package it

Repeat the five steps from weeks 5 to 6 on your chosen dataset. Expect cleaning to take far longer than it did with penguins. Then get the project ready for other eyes.

Make the notebook reproducible. Notebooks remember every variable you’ve created, in whatever order you ran the cells. Run cell 7, then cell 3, then edit cell 5, and your results can depend on a sequence nobody else can repeat. A classic version: a key chart depends on a cell you deleted an hour earlier, so the notebook looks fine on your screen and breaks for everyone else. Click Restart Kernel and Run All. If the notebook runs top to bottom without errors, it’s ready to share. If not, fix it before anyone else finds the problem.

Clean up the code. Delete scratch cells. Move repeated cleaning steps into small, well-named functions.

Put it on GitHub. Create a Git repo, add a .gitignore that leaves out big data files and cache folders, and push.

Write the README for a busy reader. Assume a hiring manager will read only that page, because many will. Cover four things: the question, the data source, what you cleaned, and two or three findings with their best charts embedded.

Checkpoint

A public GitHub repo for your portfolio project. The notebook fixes at least three data problems, answers four written questions, and passes Restart and Run All. The README explains the project in under two minutes.

FAQ

Do I need math or statistics to learn data science with Python?

For early analysis, you need basic stats, not calculus. Know how the mean and median differ, how to read spread and percentiles, what the shape of your data tells you, and why correlation doesn’t prove cause. Basic probability helps too. Learn these as you code. Linear algebra and calculus matter later, once you build machine learning models and want to know what they do under the hood.

Should I learn SQL before Python, or at the same time?

Learn both, with Python slightly ahead. A practical rhythm: Python through week 6 of the roadmap, then add an hour or two of SQL practice each week. The concepts overlap heavily. A pandas groupby and a SQL GROUP BY solve the same problem.

Can I get a data analyst job after learning Python?

Python gets you in the door, but it rarely gets you hired on its own. Most entry-level analyst jobs ask for Python plus SQL, a BI tool like Power BI or Tableau, and clear writing. What moves hiring managers is evidence: two or three projects you publish the way the roadmap’s final phase describes. Knowing an industry counts too. A marketer who can analyze campaign data often has an easier path into an analyst role than a generalist with a certificate.

Should I use AI coding assistants while I learn?

Yes, as a tutor rather than an autopilot. Write your own attempt first, then ask the assistant to explain the error message or suggest a cleaner version. Never paste code into a project that you couldn’t explain in an interview. Assistants also make confident mistakes with data, so check their numbers against describe() and your own charts.

Learn Python for Data Science

This roadmap tells you what to learn. Mimo’s Python course gives you a place to learn it, one lesson at a time.

The course takes you from your first variable through lists, functions, dictionaries, list comprehensions, classes, modules, and error handling across 14 hands-on sections. You write real code in every lesson, and built-in AI help explains errors and concepts when you get stuck. That second skill matters more each year as 51% of professional developers now use AI tools every day.

Start Mimo’s Python course for free

Henry Ameseder

AUTHOR

Henry Ameseder

Henry is the COO and a co-founder of Mimo. Since joining the team in 2016, he’s been on a mission to make coding accessible to everyone. Passionate about helping aspiring developers, Henry creates valuable content on programming, writes Python scripts, and in his free time, plays guitar.

Learn to code and land your dream job in tech

Start for free