def _get_concat_axis(self):
if self._is_series:<EOL><INDENT>if self.axis == <NUM_LIT:0>:<EOL><INDENT>indexes = [x.index for x in self.objs]<EOL><DEDENT>elif self.ignore_index:<EOL><INDENT>idx = ibase.default_index(len(self.objs))<EOL>return idx<EOL><DEDENT>elif self.keys is None:<EOL><INDENT>names = [None] * len(self.objs)<EOL>num = <NUM_LIT:0><EOL>has_names = False<EOL>for i, x in enumerate(self.objs):<EOL><INDENT>if not isinstance(x, Series):<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>.format(type=type(x).__name__))<EOL><DEDENT>if x.name is not None:<EOL><INDENT>names[i] = x.name<EOL>has_names = True<EOL><DEDENT>else:<EOL><INDENT>names[i] = num<EOL>num += <NUM_LIT:1><EOL><DEDENT><DEDENT>if has_names:<EOL><INDENT>return Index(names)<EOL><DEDENT>else:<EOL><INDENT>return ibase.default_index(len(self.objs))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return ensure_index(self.keys).set_names(self.names)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>indexes = [x._data.axes[self.axis] for x in self.objs]<EOL><DEDENT>if self.ignore_index:<EOL><INDENT>idx = ibase.default_index(sum(len(i) for i in indexes))<EOL>return idx<EOL><DEDENT>if self.keys is None:<EOL><INDENT>concat_axis = _concat_indexes(indexes)<EOL><DEDENT>else:<EOL><INDENT>concat_axis = _make_concat_multiindex(indexes, self.keys,<EOL>self.levels, self.names)<EOL><DEDENT>self._maybe_check_integrity(concat_axis)<EOL>return concat_axis<EOL>
Return index to be used along concatenation axis.