def get_iterator(self, data, axis=<NUM_LIT:0>):
if isinstance(data, NDFrame):<EOL><INDENT>slicer = lambda start, edge: data._slice(<EOL>slice(start, edge), axis=axis)<EOL>length = len(data.axes[axis])<EOL><DEDENT>else:<EOL><INDENT>slicer = lambda start, edge: data[slice(start, edge)]<EOL>length = len(data)<EOL><DEDENT>start = <NUM_LIT:0><EOL>for edge, label in zip(self.bins, self.binlabels):<EOL><INDENT>if label is not NaT:<EOL><INDENT>yield label, slicer(start, edge)<EOL><DEDENT>start = edge<EOL><DEDENT>if start < length:<EOL><INDENT>yield self.binlabels[-<NUM_LIT:1>], slicer(start, None)<EOL><DEDENT>
Groupby iterator

Returns
-------
Generator yielding sequence of (name, subsetted object)
for each group