def _apply_2d(self, func, axis):
ndim = self.ndim<EOL>axis = [self._get_axis_number(a) for a in axis]<EOL>indexer_axis = list(range(ndim))<EOL>for a in axis:<EOL><INDENT>indexer_axis.remove(a)<EOL><DEDENT>indexer_axis = indexer_axis[<NUM_LIT:0>]<EOL>slicer = [slice(None, None)] * ndim<EOL>ax = self._get_axis(indexer_axis)<EOL>results = []<EOL>for i, e in enumerate(ax):<EOL><INDENT>slicer[indexer_axis] = i<EOL>sliced = self.iloc[tuple(slicer)]<EOL>obj = func(sliced)<EOL>results.append((e, obj))<EOL><DEDENT>return self._construct_return_type(dict(results))<EOL>
Handle 2-d slices, equiv to iterating over the other axis.