def torange(array, low, high):
    """
    Render an array to value range (low, high)
    :param array: any array
    :param low, high: the range
    :return: new array
    """
    min, max = array.min(), array.max()
    # normalized to [0, 1]
    array = array - min
    array = array / (max - min)
    # to (low, high)
    array = array * (high - low) + low
    
    return array