TensorTonicTensorTonic
Problems
Study PlansProjectsInterviewPricingFeedback
Problems
Loading...
1 / 1

Implement z-Score Standardization

Data Processing
Easy

Standardize features to zero mean and unit variance.

z=x−μσz = \frac{x - \mu}{\sigma}z=σx−μ​

with μ mean and σ standard deviation.

Loading visualization...

Examples

Input: X = np.array([[1,2],[3,6],[5,10]])

Output: Standardized columns (mean≈0, std≈1)

Hint 1

Use np.mean() and np.std() with the appropriate axis and keepdims=True.

Hint 2

Use std + eps in the denominator to avoid division by zero when standard deviation is 0.

Requirements

  • Handle 1D and 2D arrays
  • Vectorized; avoid divide-by-zero (use eps)
  • Return np.ndarray (float)

Constraints

  • Up to 10⁶ elements
  • NumPy only
Try Similar Problems
Min Max ScalingRobust ScalingLog TransformRank TransformMatrix Normalization

Sign in to take notes on this problem

Case 1

Accepts: array

Accepts: number

Accepts: number

You must run your code first.
PrevNext

Implement z-Score Standardization

Data Processing
Easy

Standardize features to zero mean and unit variance.

z=x−μσz = \frac{x - \mu}{\sigma}z=σx−μ​

with μ mean and σ standard deviation.

Loading visualization...

Examples

Input: X = np.array([[1,2],[3,6],[5,10]])

Output: Standardized columns (mean≈0, std≈1)

Hint 1

Use np.mean() and np.std() with the appropriate axis and keepdims=True.

Hint 2

Use std + eps in the denominator to avoid division by zero when standard deviation is 0.

Requirements

  • Handle 1D and 2D arrays
  • Vectorized; avoid divide-by-zero (use eps)
  • Return np.ndarray (float)

Constraints

  • Up to 10⁶ elements
  • NumPy only
Try Similar Problems
Min Max ScalingRobust ScalingLog TransformRank TransformMatrix Normalization

Sign in to take notes on this problem

Case 1

Accepts: array

Accepts: number

Accepts: number

You must run your code first.