<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def count(self, **kwargs):
 """Counts the number of non-NaN objects for each column or row. Return: A new QueryCompiler object containing counts of non-NaN objects from each column or row. """

        if self._is_transposed:
            kwargs["axis"] = kwargs.get("axis", 0) ^ 1
            return self.transpose().count(**kwargs)
        axis = kwargs.get("axis", 0)
        map_func = self._build_mapreduce_func(pandas.DataFrame.count, **kwargs)
        reduce_func = self._build_mapreduce_func(pandas.DataFrame.sum, **kwargs)
        return self._full_reduce(axis, map_func, reduce_func)