Modules are Python files containing functions, classes, variables — reusable code.
Python comes with many built-in modules (math, random, datetime).
ML uses external modules: numpy, pandas, sklearn, tensorflow.
# Basic import
import math
print(math.sqrt(16)) # 4.0
# Import specific functions
from math import sqrt, pi
print(sqrt(25)) # 5.0
print(pi) # 3.14159...
# Alias for shorter name
import numpy as np
arr = np.array([1, 2, 3])
Best practice: use specific imports or aliases to avoid name conflicts.