def sum(self, axis=<NUM_LIT:0>, dtype=None):
if axis not in [<NUM_LIT:0>, <NUM_LIT:1>, '<STR_LIT:index>', '<STR_LIT>']:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>sum_kwargs = {}<EOL>if dtype is not None:<EOL><INDENT>sum_kwargs['<STR_LIT>'] = dtype<EOL><DEDENT>y = self.values.sum(axis=axis, **sum_kwargs)<EOL>if axis == <NUM_LIT:0> or axis == '<STR_LIT:index>':<EOL><INDENT>y = profile.ExpProfile(y, genes=self.cells)<EOL><DEDENT>else:<EOL><INDENT>y = profile.ExpProfile(y, genes=self.genes)<EOL><DEDENT>return y<EOL>
Sum over rows or columns.

        Overrides the default `pandas.DataFrame.sum()` function to prevent
        temporary in-memory copies.