@@ -7385,6 +7385,15 @@ def ffill(
7385
7385
dtype: float64
7386
7386
"""
7387
7387
downcast = self ._deprecate_downcast (downcast , "ffill" )
7388
+ inplace = validate_bool_kwarg (inplace , "inplace" )
7389
+ if inplace :
7390
+ if not PYPY and using_copy_on_write ():
7391
+ if sys .getrefcount (self ) <= REF_COUNT :
7392
+ warnings .warn (
7393
+ _chained_assignment_method_msg ,
7394
+ ChainedAssignmentError ,
7395
+ stacklevel = 2 ,
7396
+ )
7388
7397
7389
7398
return self ._pad_or_backfill (
7390
7399
"ffill" ,
@@ -7523,6 +7532,15 @@ def bfill(
7523
7532
3 4.0 7.0
7524
7533
"""
7525
7534
downcast = self ._deprecate_downcast (downcast , "bfill" )
7535
+ inplace = validate_bool_kwarg (inplace , "inplace" )
7536
+ if inplace :
7537
+ if not PYPY and using_copy_on_write ():
7538
+ if sys .getrefcount (self ) <= REF_COUNT :
7539
+ warnings .warn (
7540
+ _chained_assignment_method_msg ,
7541
+ ChainedAssignmentError ,
7542
+ stacklevel = 2 ,
7543
+ )
7526
7544
return self ._pad_or_backfill (
7527
7545
"bfill" ,
7528
7546
axis = axis ,
@@ -8047,6 +8065,16 @@ def interpolate(
8047
8065
raise ValueError ("downcast must be either None or 'infer'" )
8048
8066
8049
8067
inplace = validate_bool_kwarg (inplace , "inplace" )
8068
+
8069
+ if inplace :
8070
+ if not PYPY and using_copy_on_write ():
8071
+ if sys .getrefcount (self ) <= REF_COUNT :
8072
+ warnings .warn (
8073
+ _chained_assignment_method_msg ,
8074
+ ChainedAssignmentError ,
8075
+ stacklevel = 2 ,
8076
+ )
8077
+
8050
8078
axis = self ._get_axis_number (axis )
8051
8079
8052
8080
if self .empty :
@@ -8619,6 +8647,15 @@ def clip(
8619
8647
"""
8620
8648
inplace = validate_bool_kwarg (inplace , "inplace" )
8621
8649
8650
+ if inplace :
8651
+ if not PYPY and using_copy_on_write ():
8652
+ if sys .getrefcount (self ) <= REF_COUNT :
8653
+ warnings .warn (
8654
+ _chained_assignment_method_msg ,
8655
+ ChainedAssignmentError ,
8656
+ stacklevel = 2 ,
8657
+ )
8658
+
8622
8659
axis = nv .validate_clip_with_axis (axis , (), kwargs )
8623
8660
if axis is not None :
8624
8661
axis = self ._get_axis_number (axis )
@@ -10500,6 +10537,15 @@ def where(
10500
10537
3 True True
10501
10538
4 True True
10502
10539
"""
10540
+ inplace = validate_bool_kwarg (inplace , "inplace" )
10541
+ if inplace :
10542
+ if not PYPY and using_copy_on_write ():
10543
+ if sys .getrefcount (self ) <= REF_COUNT :
10544
+ warnings .warn (
10545
+ _chained_assignment_method_msg ,
10546
+ ChainedAssignmentError ,
10547
+ stacklevel = 2 ,
10548
+ )
10503
10549
other = common .apply_if_callable (other , self )
10504
10550
return self ._where (cond , other , inplace , axis , level )
10505
10551
@@ -10558,6 +10604,15 @@ def mask(
10558
10604
level : Level | None = None ,
10559
10605
) -> Self | None :
10560
10606
inplace = validate_bool_kwarg (inplace , "inplace" )
10607
+ if inplace :
10608
+ if not PYPY and using_copy_on_write ():
10609
+ if sys .getrefcount (self ) <= REF_COUNT :
10610
+ warnings .warn (
10611
+ _chained_assignment_method_msg ,
10612
+ ChainedAssignmentError ,
10613
+ stacklevel = 2 ,
10614
+ )
10615
+
10561
10616
cond = common .apply_if_callable (cond , self )
10562
10617
10563
10618
# see gh-21891
0 commit comments