Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Irv committed Feb 23, 2017
1 parent 385ca3e commit 8935068
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pandas/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ def _try_mi(k):

raise InvalidIndexError(key)

def _get_level_values(self, level):
def _get_level_values(self, level, copy=True):
"""
Return vector of label values for requested level,
equal to the length of the index
Expand All @@ -856,6 +856,7 @@ def _get_level_values(self, level):
Parameters
----------
level : int level
copy : bool whether copy of results should be done
Returns
-------
Expand All @@ -866,7 +867,11 @@ def _get_level_values(self, level):
labels = self.labels[level]
filled = algos.take_1d(unique._values, labels,
fill_value=unique._na_value)
return filled
if copy:
values = unique._shallow_copy(filled)
else:
values = filled
return values

def get_level_values(self, level):
"""
Expand All @@ -882,7 +887,7 @@ def get_level_values(self, level):
values : Index
"""
level = self._get_level_number(level)
values = self._get_level_values(level)
values = self._get_level_values(level, copy=False)
return self.levels[level]._shallow_copy(values)

def format(self, space=2, sparsify=None, adjoin=True, names=False,
Expand Down

0 comments on commit 8935068

Please sign in to comment.