<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def prod(self, **kwargs):
 """Returns the product of each numerical column or row. Return: A new QueryCompiler object with the product of each numerical column or row. """

        if self._is_transposed:
            kwargs["axis"] = kwargs.get("axis", 0) ^ 1
            return self.transpose().prod(**kwargs)
        return self._process_sum_prod(
            self._build_mapreduce_func(pandas.DataFrame.prod, **kwargs), **kwargs
        )