NumPy sits at the center of the scientific Python stack. Libraries build on its ndarray API rather than reinventing array storage.
Downstream libraries
- Pandas — DataFrame wraps ndarray columns with labels
- Matplotlib — plots accept NumPy arrays directly
- SciPy — statistics, optimization, sparse matrices on NumPy
- scikit-learn — estimators expect
Xas 2D float arrays - PyTorch / TensorFlow — tensor APIs inspired by NumPy (with GPU backends)
Array interchange
Many libraries expose .values, .to_numpy(), or zero-copy views. Understanding NumPy memory layout helps you avoid silent copies.
Version and capabilities
import numpy as np
print(np.__version__)
print('float64 itemsize:', np.dtype('float64').itemsize, 'bytes')
Important interview questions and answers
- Q: Pandas relationship?
A: DataFrame columns are often backed by 1D ndarrays; groupby and merge add labels on top. - Q: Why learn NumPy before Pandas?
A: Pandas vectorization and dtype behavior inherit NumPy semantics—fewer surprises.
Self-check
- Name three libraries that depend on NumPy.
- What track comes after NumPy for tabular data?
Tip: Plan Pandas next after ndarray basics.
Interview prep
- Pandas relation?
DataFrame columns are often 1D ndarrays with labels on top.
- SciPy role?
Extends NumPy with stats, optimization, sparse matrices.