normalize#

normalize(arr, minval=0.0, maxval=1.0)[source]#

Rescale an array between a minimum value and a maximum value.

Parameters:
  • arr (array) – array to normalize

  • minval (float) – minimum value in rescaled array

  • maxval (float) – maximum value in rescaled array

Example:

normarr = sc.normalize([2,3,7,27]) # Returns array([0.  , 0.04, 0.2 , 1.  ])