def reduce(vector):
        """
        Can be a vector or matrix. If data are bool, sum Trues.
        """
        if type(vector) is list: # matrix
            return array(list(map(multiply.reduce, vector)))
        else:
            return reduce(operator.mul, vector)
Can be a vector or matrix. If data are bool, sum Trues.