Skip to content

Python Essentials for ML

The Libraries That Matter

6 min+55 XPStep 1/10

Python is small; the ecosystem is the point

Bare Python can't multiply two vectors or read a CSV into a table. The power is in libraries — other people's tested, optimized code that you bolt on with import.

Nearly every data notebook on Earth opens with some version of:

  • import numpy as np — arrays and math
  • import pandas as pd — tables
  • import matplotlib.pyplot as plt — plots
  • import seaborn as sns — prettier plots

The as np part creates a short alias — np.array(...) instead of numpy.array(...). These aliases are shared conventions, not personal taste: np, pd, and plt mean the same thing in every codebase you'll ever read.

insight

Scikit-learn, PyTorch, and TensorFlow all speak the same dialect: they consume NumPy arrays and pandas DataFrames. Learn the four imports above and the entire ML stack opens up.