def sep_num(number, space=True):
    """
    Creates a string representation of a number with separators each thousand. If space is True, then it uses spaces for
    the separator otherwise it will use commas

    Note
    ----
    Source: https://stackoverflow.com/questions/16670125/python-format-string-thousand-separator-with-spaces

    :param number: A number
    :type number: int | float

    :param space: Separates numbers with spaces if True, else with commas
    :type space: bool

    :return: string representation with space separation
    :rtype: str
    """
    if space:
        return '{:,}'.format(number).replace(',', ' ')
    else:
        return '{:,}'.format(number)