Reference · Glossary
NumPy
Last updated
A Python library for **fast arrays of numbers** — the foundation pandas, scikit-learn, and PyTorch are all built on top of. Operations apply to a whole array at once (vectorized) instead of looping element by element.
#When to use
Any numeric computation across many values at once: scores, pixel values, model weights, distances between vectors.
#When not to
Mixed-type records (a name, a flag, and a score together) — use a plain Python list/dict or a pandas DataFrame instead.
#Example
import numpy as np
scores = np.array([88, 92, 79])
print(scores.mean(), (scores > 80).sum())