Skip to content

Commit 2834bbb

Browse files
committed
Fix warnings for inplace ops
1 parent b506bfb commit 2834bbb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12450,7 +12450,7 @@ def _inplace_method(self, other, op) -> Self:
1245012450
"""
1245112451
warn = True
1245212452
if not PYPY and warn_copy_on_write():
12453-
if sys.getrefcount(self) <= 4:
12453+
if sys.getrefcount(self) <= REF_COUNT * 2:
1245412454
# we are probably in an inplace setitem context (e.g. df['a'] += 1)
1245512455
warn = False
1245612456

0 commit comments

Comments
 (0)