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