Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
_append_same_dtype -> _concat_same_dtype
  • Loading branch information
toobaz committed Aug 21, 2017
commit 554ee79709cbb5fdd3e8ef8e3e6553e6fa499cf9
4 changes: 2 additions & 2 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1748,10 +1748,10 @@ def _concat(self, to_concat, name):
typs = _concat.get_dtype_kinds(to_concat)

if len(typs) == 1:
return self._append_same_dtype(to_concat, name=name)
return self._concat_same_dtype(to_concat, name=name)
return _concat._concat_index_asobject(to_concat, name=name)

def _append_same_dtype(self, to_concat, name):
def _concat_same_dtype(self, to_concat, name):
"""
Concatenate to_concat which has the same class
"""
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/indexes/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,9 @@ def insert(self, loc, item):

def _concat(self, to_concat, name):
# if calling index is category, don't check dtype of others
return CategoricalIndex._append_same_dtype(self, to_concat, name)
return CategoricalIndex._concat_same_dtype(self, to_concat, name)

def _append_same_dtype(self, to_concat, name):
def _concat_same_dtype(self, to_concat, name):
"""
Concatenate to_concat which has the same class
ValueError if other is not in the categories
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ def summary(self, name=None):
result = result.replace("'", "")
return result

def _append_same_dtype(self, to_concat, name):
def _concat_same_dtype(self, to_concat, name):
"""
Concatenate to_concat which has the same class
"""
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/indexes/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ def _as_like_interval_index(self, other, error_msg):
raise ValueError(error_msg)
return other

def _append_same_dtype(self, to_concat, name):
def _concat_same_dtype(self, to_concat, name):
"""
assert that we all have the same .closed
we allow a 0-len index here as well
Expand All @@ -876,7 +876,7 @@ def _append_same_dtype(self, to_concat, name):
msg = ('can only append two IntervalIndex objects '
'that are closed on the same side')
raise ValueError(msg)
return super(IntervalIndex, self)._append_same_dtype(to_concat, name)
return super(IntervalIndex, self)._concat_same_dtype(to_concat, name)

@Appender(_index_shared_docs['take'] % _index_doc_kwargs)
def take(self, indices, axis=0, allow_fill=True,
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/range.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def join(self, other, how='left', level=None, return_indexers=False,
return super(RangeIndex, self).join(other, how, level, return_indexers,
sort)

def _append_same_dtype(self, indexes, name):
def _concat_same_dtype(self, indexes, name):
return _concat._concat_rangeindex_same_dtype(indexes).rename(name)

def __len__(self):
Expand Down