def _wva(values, weights):
        """ Calculates a weighted average
        """
        assert len(values) == len(weights) and len(weights) > 0
        return sum([mul(*x) for x in zip(values, weights)]) / sum(weights)