# Path: simplestatistics/statistics/mean.py
# def mean(data):
#     """
#     The mean_, or *average*, is "the sum of values divided by the number of values".
# 
#     .. _mean: https://en.wikipedia.org/wiki/Mean
# 
#     Equation:
#         .. math::
#             \\bar{X} = \\frac{\\sum X}{n}
# 
#     Args:
#         data: A numeric built-in object, a tuple,
#             or list of numeric objects.
# 
#     Returns:
#         A float object.
# 
#     Examples:
# 
#         >>> mean([1])
#         1.0
#         >>> mean([1, 2])
#         1.5
#         >>> mean([1, 2, 3])
#         2.0
#         >>> mean([-1, 0, 1, 2, 3])
#         1.0
#     """
#     data = decimalize(copy.deepcopy(data)) # don't modify the original data
#     return float(sum(data) / len(data))


from .mean import mean
        -3.5
        >>> covariance([1,2,3], [4, 4.5, 5])
        0.5

        >>> covariance(2, 3) # doctest: +ELLIPSIS
        Traceback (most recent call last):
            ...
        ValueError: To calculate covariance you need lists or tuples of equal length...
        >>> covariance([2, 4], [6, 6.5, 7]) # doctest: +ELLIPSIS
        Traceback (most recent call last):
            ...
        ValueError: To calculate covariance you need lists or tuples of equal length...
        >>> covariance([1], [-1])
        Traceback (most recent call last):
            ...
        ValueError: covariance requires lists of equal length where length is > 1.
    """

    if type(x) not in [list, tuple] or type(y) not in [list, tuple]:
        raise ValueError("To calculate covariance you need lists or tuples of "
                         "equal length. Length must be > 1.")

    if len(x) != len(y):
        raise ValueError("To calculate covariance you need lists or tuples of "
                         "equal length. Length must be > 1.")

    if len(x) <= 1 or len(y) <= 1:
        raise ValueError("covariance requires lists of equal length where length is > 1.")

    xmean = mean(x[:])

# Path: simplestatistics/statistics/mean.py
# def mean(data):
#     """
#     The mean_, or *average*, is "the sum of values divided by the number of values".
# 
#     .. _mean: https://en.wikipedia.org/wiki/Mean
# 
#     Equation:
#         .. math::
#             \\bar{X} = \\frac{\\sum X}{n}
# 
#     Args:
#         data: A numeric built-in object, a tuple,
#             or list of numeric objects.
# 
#     Returns:
#         A float object.
# 
#     Examples:
# 
#         >>> mean([1])
#         1.0
#         >>> mean([1, 2])
#         1.5
#         >>> mean([1, 2, 3])
#         2.0
#         >>> mean([-1, 0, 1, 2, 3])
#         1.0
#     """
#     data = decimalize(copy.deepcopy(data)) # don't modify the original data
#     return float(sum(data) / len(data))


# Path: simplestatistics/statistics/covariance.py
from .mean import mean

        -3.5
        >>> covariance([1,2,3], [4, 4.5, 5])
        0.5

        >>> covariance(2, 3) # doctest: +ELLIPSIS
        Traceback (most recent call last):
            ...
        ValueError: To calculate covariance you need lists or tuples of equal length...
        >>> covariance([2, 4], [6, 6.5, 7]) # doctest: +ELLIPSIS
        Traceback (most recent call last):
            ...
        ValueError: To calculate covariance you need lists or tuples of equal length...
        >>> covariance([1], [-1])
        Traceback (most recent call last):
            ...
        ValueError: covariance requires lists of equal length where length is > 1.
    """

    if type(x) not in [list, tuple] or type(y) not in [list, tuple]:
        raise ValueError("To calculate covariance you need lists or tuples of "
                         "equal length. Length must be > 1.")

    if len(x) != len(y):
        raise ValueError("To calculate covariance you need lists or tuples of "
                         "equal length. Length must be > 1.")

    if len(x) <= 1 or len(y) <= 1:
        raise ValueError("covariance requires lists of equal length where length is > 1.")

    xmean = mean(x[:])

    ymean = mean(y[:])