Skip to content

Commit

Permalink
MAINT: .take() --> ._take()
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyoung committed Sep 23, 2017
1 parent 35812d0 commit f30634f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2000,7 +2000,7 @@ def _ixs(self, i, axis=0):
label = self.index[i]
if isinstance(label, Index):
# a location index by definition
result = self.take(i, axis=axis)
result = self._take(i, axis=axis)
copy = True
else:
new_values = self._data.fast_xs(i)
Expand Down Expand Up @@ -2032,7 +2032,7 @@ def _ixs(self, i, axis=0):
return self.loc[:, lab_slice]
else:
if isinstance(label, Index):
return self.take(i, axis=1)
return self._take(i, axis=1, convert=True)

index_len = len(self.index)

Expand Down Expand Up @@ -2114,10 +2114,10 @@ def _getitem_array(self, key):
# be reindexed to match DataFrame rows
key = check_bool_indexer(self.index, key)
indexer = key.nonzero()[0]
return self.take(indexer, axis=0)
return self._take(indexer, axis=0, convert=False)
else:
indexer = self.loc._convert_to_indexer(key, axis=1)
return self.take(indexer, axis=1)
return self._take(indexer, axis=1, convert=True)

def _getitem_multilevel(self, key):
loc = self.columns.get_loc(key)
Expand Down Expand Up @@ -3333,7 +3333,7 @@ def dropna(self, axis=0, how='any', thresh=None, subset=None,
check = indices == -1
if check.any():
raise KeyError(list(np.compress(check, subset)))
agg_obj = self.take(indices, axis=agg_axis)
agg_obj = self._take(indices, axis=agg_axis)

count = agg_obj.count(axis=agg_axis)

Expand All @@ -3349,7 +3349,7 @@ def dropna(self, axis=0, how='any', thresh=None, subset=None,
else:
raise TypeError('must specify how or thresh')

result = self.take(mask.nonzero()[0], axis=axis)
result = self._take(mask.nonzero()[0], axis=axis, convert=False)

if inplace:
self._update_inplace(result)
Expand Down Expand Up @@ -3483,9 +3483,9 @@ def trans(v):
indexer = nargsort(k, kind=kind, ascending=ascending,
na_position=na_position)

new_data = self._data.take(indexer,
axis=self._get_block_manager_axis(axis),
verify=False)
new_data = self._data._take(indexer,
axis=self._get_block_manager_axis(axis),
convert=False, verify=False)

if inplace:
return self._update_inplace(new_data)
Expand Down Expand Up @@ -3544,9 +3544,9 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
na_position=na_position)

baxis = self._get_block_manager_axis(axis)
new_data = self._data.take(indexer,
axis=baxis,
verify=False)
new_data = self._data._take(indexer,
axis=baxis,
convert=False, verify=False)

# reconstruct axis if needed
new_data.axes[baxis] = new_data.axes[baxis]._sort_levels_monotonic()
Expand Down

0 comments on commit f30634f

Please sign in to comment.