Skip to content

Commit 6f953a8

Browse files
authored
PERF: clipping with scalar (#41869)
1 parent cecc3a1 commit 6f953a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/generic.py

Lines changed: 2 additions & 2 deletions
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)