diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 0bcbf59914839..87268bdf4f8fb 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -5009,7 +5009,7 @@ def sample( ) locs = rs.choice(axis_length, size=n, replace=replace, p=weights) - return self.take(locs, axis=axis, is_copy=False) + return self.take(locs, axis=axis) _shared_docs[ "pipe" @@ -7006,7 +7006,7 @@ def asof(self, where, subset=None): # mask the missing missing = locs == -1 - data = self.take(locs, is_copy=False) + data = self.take(locs) data.index = where data.loc[missing] = np.nan return data if is_list else data.iloc[-1] diff --git a/pandas/core/groupby/grouper.py b/pandas/core/groupby/grouper.py index 05a5458f60cf5..1c49335dfc4f0 100644 --- a/pandas/core/groupby/grouper.py +++ b/pandas/core/groupby/grouper.py @@ -194,7 +194,7 @@ def _set_grouper(self, obj: FrameOrSeries, sort: bool = False): # use stable sort to support first, last, nth indexer = self.indexer = ax.argsort(kind="mergesort") ax = ax.take(indexer) - obj = obj.take(indexer, axis=self.axis, is_copy=False) + obj = obj.take(indexer, axis=self.axis) self.obj = obj self.grouper = ax