def get_symmetrical_std_dev(values, take_positive_values, ignore_zeros = True):
    """Computes the standard deviation of either the positive or negative subset of values.
       The subset is first converted into a symmetrical set of values by unioning it with its complemented/mirrored set
       along the origin i.e. if x is a value in the subset then both x and -x are members of the symmetrical set.
       The standard deviation is then computed on this symmetrical set.

       Note: zeroes are generally ignored as they could be included into both sides of a distribution split.

    :param values: A list of numerical values.
    :param take_positive_values: If True then the subset of positive numbers in values is considered. Otherwise, the subset of negative values is considered.
    :param ignore_zeros: Whether or not zeroes should be considered when determining the standard deviations.
    :return:
    """
    if take_positive_values:
        if ignore_zeros:
            temp_pos = np.array([value for value in values if value > 0.0])
        else:
            temp_pos = np.array([value for value in values if value >= 0.0])
    else:
        if ignore_zeros:
            temp_pos = np.array([value for value in values if value < 0.0])
        else:
            temp_pos = np.array([value for value in values if value <= 0.0])

    # Convert the subset into a symmetrical distribution
    temp_pos = np.concatenate((temp_pos, -temp_pos))

    # Calculate standard deviations for sigma-based significance cutoffs
    std_dev = np.std(temp_pos)

    if not take_positive_values:
        # Return a negative standard deviation for the subset of negative values
        std_dev = -std_dev
    return std_dev
def get_symmetrical_std_dev ( values , take_positive_values , ignore_zeros = True ) : if take_positive_values : if ignore_zeros : temp_pos = np . array ( [ value for value in values if value > 0.0 ] ) else : temp_pos = np . array ( [ value for value in values if value >= 0.0 ] ) else : if ignore_zeros : temp_pos = np . array ( [ value for value in values if value < 0.0 ] ) else : temp_pos = np . array ( [ value for value in values if value <= 0.0 ] ) temp_pos = np . concatenate ( ( temp_pos , - temp_pos ) ) std_dev = np . std ( temp_pos ) if not take_positive_values : std_dev = - std_dev return std_dev
Computes the standard deviation of either the positive or negative subset of values.
       The subset is first converted into a symmetrical set of values by unioning it with its complemented/mirrored set
       along the origin i.e. if x is a value in the subset then both x and -x are members of the symmetrical set.
       The standard deviation is then computed on this symmetrical set.

       Note: zeroes are generally ignored as they could be included into both sides of a distribution split.

    :param values: A list of numerical values.
    :param take_positive_values: If True then the subset of positive numbers in values is considered. Otherwise, the subset of negative values is considered.
    :param ignore_zeros: Whether or not zeroes should be considered when determining the standard deviations.
    :return: