NORMALIZE

All functions > ARRAY > NORMALIZE

Normalizes a numeric array by dividing each element by the sum of all elements.

Syntax

NORMALIZE(array)
sql

Arguments

ParameterTypeRequiredDescription
arrayARRAYTINYINTYesArray of numeric values to normalize

Returns

ARRAY(DOUBLE) - Normalized array where elements sum to 1

Notes

  • Divides each element by sum of all elements
  • Result sums to 1.0 (probability distribution)
  • Useful for creating probability vectors
  • Returns array of doubles
Last update at: 2025/10/13 10:23:46