Skip to content

Commit 4ea013b

Browse files
TLoufJulianWgs
authored andcommitted
PERF: clipping with scalar (pandas-dev#41869)
1 parent 092c66f commit 4ea013b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/generic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7218,10 +7218,10 @@ def _clip_with_scalar(self, lower, upper, inplace: bool_t = False):
72187218

72197219
with np.errstate(all="ignore"):
72207220
if upper is not None:
7221-
subset = (self <= upper).to_numpy()
7221+
subset = self <= upper
72227222
result = result.where(subset, upper, axis=None, inplace=False)
72237223
if lower is not None:
7224-
subset = (self >= lower).to_numpy()
7224+
subset = self >= lower
72257225
result = result.where(subset, lower, axis=None, inplace=False)
72267226

72277227
if np.any(mask):

0 commit comments

Comments
 (0)