From e9c9bd9be59229ed13c3fa608dc9a0e214b501dc Mon Sep 17 00:00:00 2001 From: gfyoung Date: Sat, 23 Sep 2017 11:10:36 -0700 Subject: [PATCH] MAINT: .take() --> ._take() --- pandas/core/frame.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 47955b5e5cfee0..bbf46aa92920a6 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -3485,7 +3485,7 @@ def trans(v): new_data = self._data.take(indexer, axis=self._get_block_manager_axis(axis), - verify=False) + convert=False, verify=False) if inplace: return self._update_inplace(new_data) @@ -3546,7 +3546,7 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False, baxis = self._get_block_manager_axis(axis) new_data = self._data.take(indexer, axis=baxis, - verify=False) + convert=False, verify=False) # reconstruct axis if needed new_data.axes[baxis] = new_data.axes[baxis]._sort_levels_monotonic()