<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def idxmax(self, **kwargs):
 """Returns the first occurrence of the maximum over requested axis. Returns: A new QueryCompiler object containing the maximum of each column or axis. """

        if self._is_transposed:
            kwargs["axis"] = kwargs.get("axis", 0) ^ 1
            return self.transpose().idxmax(**kwargs)

        axis = kwargs.get("axis", 0)
        index = self.index if axis == 0 else self.columns

        def idxmax_builder(df, **kwargs):
            if axis == 0:
                df.index = index
            else:
                df.columns = index
            return df.idxmax(**kwargs)

        func = self._build_mapreduce_func(idxmax_builder, **kwargs)
        return self._full_axis_reduce(axis, func)