Standardization
Standardization subtracts a feature’s mean and divides by its standard deviation, so features become comparable.
mean, std = D.mean(axis=0), D.std(axis=0)
Z = (D - mean) / np.where(std == 0, 1.0, std)
It matters far beyond this section: take-home A shows that without it, PCA reports the largest unit rather than the largest pattern.