eccpy/tools.py
def normalise_0_1(arraylike):
    """ Normalise an array to values between 0 and 1.

    The following linear formula is used.
    norm_array = (orig_array - array_min)/(array_max - array_min)

    The use of this simple linear formula allows the normalised data to be "denormalised" later, so long as
    the min and max values of the original array are known.

    Parameters
    ----------
    arraylike : array
        Numpy array (or other arraylike) dataset of floats or ints to be normalised.

    Returns
    -------
    normalised : array
        Array of floats, containing the normalised datapoints.
    array_min : float
        Minimum value of the original data. Necessary in order to "denormalise" the data later, back to the effective
        original values.
    array_max : float
        Maximum value of the original data. Necessary in order to "denormalise" the data later, back to the effective
        original values.

    Usage
    -----
    normalised_array, min_, max_ = normalise_0_1(original_array)
    # or, if denormalisation is not necessary
    normalised_array = normalise_0_1(original_array)[0]
    # for further usage examples, see the docstring for denormalise_0_1
    """
    array_min = np.min(arraylike)
    array_max = np.max(arraylike)
    normalised = (arraylike - array_min)/(array_max - array_min)
    # convert to float
    normalised = np.array(normalised).astype(float)
    return normalised, array_min, array_max
 Normalise an array to values between 0 and 1.

    The following linear formula is used.
    norm_array = (orig_array - array_min)/(array_max - array_min)

    The use of this simple linear formula allows the normalised data to be "denormalised" later, so long as
    the min and max values of the original array are known.

    Parameters
    ----------
    arraylike : array
        Numpy array (or other arraylike) dataset of floats or ints to be normalised.

    Returns
    -------
    normalised : array
        Array of floats, containing the normalised datapoints.
    array_min : float
        Minimum value of the original data. Necessary in order to "denormalise" the data later, back to the effective
        original values.
    array_max : float
        Maximum value of the original data. Necessary in order to "denormalise" the data later, back to the effective
        original values.

    Usage
    -----
    normalised_array, min_, max_ = normalise_0_1(original_array)
    # or, if denormalisation is not necessary
    normalised_array = normalise_0_1(original_array)[0]
    # for further usage examples, see the docstring for denormalise_0_1
    
Normalise an array to values between 0 and 1.
The following linear formula is used.

The use of this simple linear formula allows the normalised data to be "denormalised" later, so long as
the min and max values of the original array are known.

Parameters

arraylike : array
Numpy array (or other arraylike) dataset of floats or ints to be normalised.

Returns

normalised : array
Array of floats, containing the normalised datapoints.
array_min : float
Minimum value of the original data. Necessary in order to "denormalise" the data later, back to the effective
original values.
array_max : float
Maximum value of the original data. Necessary in order to "denormalise" the data later, back to the effective
original values.

Usage


Normalise an array to values between 0 and 1 . The following linear formula is used . The use of this simple linear formula allows the normalised data to be " denormalised " later so long as the min and max values of the original array are known . Parameters arraylike : array Numpy array ( or other arraylike ) dataset of floats or ints to be normalised . Returns normalised : array Array of floats containing the normalised datapoints . array_min : float Minimum value of the original data . Necessary in order to " denormalise " the data later back to the effective original values . array_max : float Maximum value of the original data . Necessary in order to " denormalise " the data later back to the effective original values . Usage
def normalise_0_1(arraylike):
    array_min = np.min(arraylike)
    array_max = np.max(arraylike)
    normalised = (arraylike - array_min)/(array_max - array_min)
    normalised = np.array(normalised).astype(float)
    return normalised, array_min, array_max
def normalise_0_1 ( arraylike ) : array_min = np . min ( arraylike ) array_max = np . max ( arraylike ) normalised = ( arraylike - array_min ) / ( array_max - array_min ) normalised = np . array ( normalised ) . astype ( float ) return normalised , array_min , array_max
Normalise an array to values between 0 and 1.
Normalise an array to values between 0 and 1 .
""" Normalise an array to values between 0 and 1.

    The following linear formula is used.
    norm_array = (orig_array - array_min)/(array_max - array_min)

    The use of this simple linear formula allows the normalised data to be "denormalised" later, so long as
    the min and max values of the original array are known.

    Parameters
    ----------
    arraylike : array
        Numpy array (or other arraylike) dataset of floats or ints to be normalised.

    Returns
    -------
    normalised : array
        Array of floats, containing the normalised datapoints.
    array_min : float
        Minimum value of the original data. Necessary in order to "denormalise" the data later, back to the effective
        original values.
    array_max : float
        Maximum value of the original data. Necessary in order to "denormalise" the data later, back to the effective
        original values.

    Usage
    -----
    normalised_array, min_, max_ = normalise_0_1(original_array)
    # or, if denormalisation is not necessary
    normalised_array = normalise_0_1(original_array)[0]
    # for further usage examples, see the docstring for denormalise_0_1
    """ # convert to float
arraylike