@@ -7385,6 +7385,15 @@ def ffill(
73857385 dtype: float64
73867386 """
73877387 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+ )
73887397
73897398 return self ._pad_or_backfill (
73907399 "ffill" ,
@@ -7523,6 +7532,15 @@ def bfill(
75237532 3 4.0 7.0
75247533 """
75257534 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+ )
75267544 return self ._pad_or_backfill (
75277545 "bfill" ,
75287546 axis = axis ,
@@ -8047,6 +8065,16 @@ def interpolate(
80478065 raise ValueError ("downcast must be either None or 'infer'" )
80488066
80498067 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+
80508078 axis = self ._get_axis_number (axis )
80518079
80528080 if self .empty :
@@ -8619,6 +8647,15 @@ def clip(
86198647 """
86208648 inplace = validate_bool_kwarg (inplace , "inplace" )
86218649
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+
86228659 axis = nv .validate_clip_with_axis (axis , (), kwargs )
86238660 if axis is not None :
86248661 axis = self ._get_axis_number (axis )
@@ -10500,6 +10537,15 @@ def where(
1050010537 3 True True
1050110538 4 True True
1050210539 """
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+ )
1050310549 other = common .apply_if_callable (other , self )
1050410550 return self ._where (cond , other , inplace , axis , level )
1050510551
@@ -10558,6 +10604,15 @@ def mask(
1055810604 level : Level | None = None ,
1055910605 ) -> Self | None :
1056010606 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+
1056110616 cond = common .apply_if_callable (cond , self )
1056210617
1056310618 # see gh-21891
0 commit comments