Explore Library
Code QuizIntermediate

Z-Score Standardization

Identify the scaling error in this z-score standardization.

Codepython
import numpy as np

x = np.array([2, 4, 4, 4, 5, 5, 7, 9])

# Standardize to mean 0, std 1
standardized = (x - x.mean()) / x.var()
print(standardized)

What is the bug in this standardization code?