Skip to content

Commit f30634f

Browse files
committed
MAINT: .take() --> ._take()
1 parent 35812d0 commit f30634f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

pandas/core/frame.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,7 @@ def _ixs(self, i, axis=0):
20002000
label = self.index[i]
20012001
if isinstance(label, Index):
20022002
# a location index by definition
2003-
result = self.take(i, axis=axis)
2003+
result = self._take(i, axis=axis)
20042004
copy = True
20052005
else:
20062006
new_values = self._data.fast_xs(i)
@@ -2032,7 +2032,7 @@ def _ixs(self, i, axis=0):
20322032
return self.loc[:, lab_slice]
20332033
else:
20342034
if isinstance(label, Index):
2035-
return self.take(i, axis=1)
2035+
return self._take(i, axis=1, convert=True)
20362036

20372037
index_len = len(self.index)
20382038

@@ -2114,10 +2114,10 @@ def _getitem_array(self, key):
21142114
# be reindexed to match DataFrame rows
21152115
key = check_bool_indexer(self.index, key)
21162116
indexer = key.nonzero()[0]
2117-
return self.take(indexer, axis=0)
2117+
return self._take(indexer, axis=0, convert=False)
21182118
else:
21192119
indexer = self.loc._convert_to_indexer(key, axis=1)
2120-
return self.take(indexer, axis=1)
2120+
return self._take(indexer, axis=1, convert=True)
21212121

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

33383338
count = agg_obj.count(axis=agg_axis)
33393339

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

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

33543354
if inplace:
33553355
self._update_inplace(result)
@@ -3483,9 +3483,9 @@ def trans(v):
34833483
indexer = nargsort(k, kind=kind, ascending=ascending,
34843484
na_position=na_position)
34853485

3486-
new_data = self._data.take(indexer,
3487-
axis=self._get_block_manager_axis(axis),
3488-
verify=False)
3486+
new_data = self._data._take(indexer,
3487+
axis=self._get_block_manager_axis(axis),
3488+
convert=False, verify=False)
34893489

34903490
if inplace:
34913491
return self._update_inplace(new_data)
@@ -3544,9 +3544,9 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
35443544
na_position=na_position)
35453545

35463546
baxis = self._get_block_manager_axis(axis)
3547-
new_data = self._data.take(indexer,
3548-
axis=baxis,
3549-
verify=False)
3547+
new_data = self._data._take(indexer,
3548+
axis=baxis,
3549+
convert=False, verify=False)
35503550

35513551
# reconstruct axis if needed
35523552
new_data.axes[baxis] = new_data.axes[baxis]._sort_levels_monotonic()

0 commit comments

Comments
 (0)