Skip to content
Start Here8 min read

Why Python for Data

Free lesson

Python won data work not because it is the best language but because of its ecosystem. Here is the honest version.

What you will be able to do

  • Know why Python became the standard for data work
  • Know which parts of Python you can skip for now

Python is not the fastest language. It is not the safest, or the tidiest. On pure language design, several others beat it.

What made Python win data work is something else: almost everyone who writes a tool for data writes it for Python. NumPy, pandas, scikit-learn, PyTorch — all in one place, and all aware of each other. A DataFrame goes straight into fit() with no conversion. That is not a technical advantage, it is an ecosystem advantage, and for daily work it is the one that decides things.

What you do not need to learn yet#

This part is rarely said out loud. Python is large, and most of it is irrelevant to data analysis. You can be productive without ever touching:

FeatureWhen you need itNow?
Classes and OOPWriting your own libraryNo
DecoratorsUsing a web frameworkNo
async / awaitHandling thousands of connectionsNo
Type hintsCode other people depend onLater
Lists, dicts, comprehensionsEvery dayYes
pandasEvery dayYes
Reading a tracebackEvery day, often repeatedlyYes
The last three rows are what this track contains. The rest can wait.

A curriculum that opens with class Animal: is not wrong — it is right for a future software engineer. For somebody who wants to know why sales fell last month, it is six weeks before they touch any data.

Checkpoint

Your goal: find out why sales fell last month. Which of these can safely wait?

One line that explains the whole thing#

example.py· python
import pandas as pd df = pd.read_csv('sales.csv')print(df.groupby('city')['total'].mean().sort_values(ascending=False).head(3))
Output
city
Surabaya    412500.0
Jakarta     388200.0
Bandung     351750.0
Name: total, dtype: float64

Four lines, and three of them are one line that reads a file, groups, averages, sorts and takes the top three. In most other languages this is thirty lines. That is the reason.

Checkpoint

According to this lesson, what is the main reason Python dominates data work?

Before you continue
0/3