def _wrap_results(self, results, blocks, obj):
from pandas import Series, concat<EOL>from pandas.core.index import ensure_index<EOL>final = []<EOL>for result, block in zip(results, blocks):<EOL><INDENT>result = self._wrap_result(result, block=block, obj=obj)<EOL>if result.ndim == <NUM_LIT:1>:<EOL><INDENT>return result<EOL><DEDENT>final.append(result)<EOL><DEDENT>columns = self._selected_obj.columns<EOL>if self.on is not None and not self._on.equals(obj.index):<EOL><INDENT>name = self._on.name<EOL>final.append(Series(self._on, index=obj.index, name=name))<EOL>if self._selection is not None:<EOL><INDENT>selection = ensure_index(self._selection)<EOL>if name not in selection:<EOL><INDENT>columns = self.obj.columns<EOL>indexer = columns.get_indexer(selection.tolist() + [name])<EOL>columns = columns.take(sorted(indexer))<EOL><DEDENT><DEDENT><DEDENT>if not len(final):<EOL><INDENT>return obj.astype('<STR_LIT>')<EOL><DEDENT>return concat(final, axis=<NUM_LIT:1>).reindex(columns=columns, copy=False)<EOL>
Wrap the results.

Parameters
----------
results : list of ndarrays
blocks : list of blocks
obj : conformed data (may be resampled)