+
    xȇi.              
          ^ RI t^ RIt^ RIHtHt ^ RIHt ^ RI	H
t
 ]P                  P                  RRR^R^/RR)/RR^/RR)/RR^/RR)/RR^^///.4      R	 4       tR
 tR tR tR tR tR tR tR t]P                  P                  RRR.. .4      R 4       t]P                  P                  RRR..4      R 4       t]P                  P                  RRR.4      R 4       t]P                  P                  R^^..4      R 4       tR tR t]P                  P                  RRR.4      R 4       tR t]P                  P                  RRR.4      R  4       tR! tR" t R# t!R$ t"R% t#R& t$R' t%R( t&R# )*    N)Categorical	DataFrame)	get_arrayreplace_kwargs
to_replaceabvaluec           	         \        R . ROR. ROR. RO/4      pVP                  4       pVP                  ! R/ V B pVR,          VR,          8H  P                  4       '       d4   \        P
                  ! \        VR4      \        VR4      4      '       g   Q h\        P
                  ! \        VR4      \        VR4      4      '       g   Q hR	VP                  R
&   \        P
                  ! \        VR4      \        VR4      4      '       d   Q hR V R,          9   dE   \        VR 4      p^dVP                  R&   \        P
                  ! \        VR 4      V4      '       g   Q h\        P                  ! W4       R# )r   r	   cr   N         )         )g?g?g333333? r   r   )r   r   )
r   copyreplaceallnpshares_memoryr   tmlocassert_frame_equal)r   dfdf_origdf_replacedarrs   &    s/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/copy_view/test_replace.pytest_replacer$      s.     
CCCI	JBggiG**.~.KCBsG#((**	+s ;Yr3=OPPPPIk372s9KLLLL !KOOF	+s ;Yr3=OPPPP
n\**S)"%	+s ;SAAAA"&    c                  \   \        R RR./4      p V P                  4       pV R,          p\        V R 4      pV P                  RRRRR7       \        P
                  ! V\        V R 4      4      '       d   Q hV P                  P                  ^ 4      '       g   Q h\        P                  ! W!4       R# )	r   aaabbbNNN^a.*$newTr   r
   inplaceregexN)
r   r   r   r   r   r   _mgr_has_no_referencer   r   )r   r    viewr"   s       r#   test_replace_regex_inplace_refsr2   0   s    	C%(	)BggiGa5D
B
CJJ(%TJJYr3%7888877$$Q''''$(r%   c                     \        R RR./4      p \        V R 4      pV P                  RRRRR7       V P                  P	                  ^ 4      '       g   Q h\
        P                  ! V\        V R 4      4      '       g   Q hV P                  4       pV P                  RRRR7      p\
        P                  ! W 4       \
        P                  ! \        VR 4      \        V R 4      4      '       d   Q hR	# )
r   r'   r(   r*   r+   Tr,   z^b.*$r   r
   r.   N)	r   r   r   r/   r0   r   r   r   r   r   r"   r    df2s       r#   test_replace_regex_inplacer7   ;   s    	C%(	)B
B
CJJ(%TJJ77$$Q''''C2s!34444ggiG
**T*
BC'&	#s 3Yr35GHHHHHr%   c                     \        R ^^./4      p \        V R 4      pV P                  RRRRR7       V P                  P	                  ^ 4      '       g   Q h\
        P                  ! V\        V R 4      4      '       g   Q hV P                  4       pV P                  RRRR7      p\        P                  ! W 4       \
        P                  ! \        VR 4      \        V R 4      4      '       g   Q hR# )r   z^a.$r+   Tr,   z^x.$r4   N)
r   r   r   r/   r0   r   r   r   r   r   r5   s       r#    test_replace_regex_inplace_no_opr9   H   s    	C!Q=	!B
B
CJJ'DJI77$$Q''''C2s!34444ggiG
**uD*
AC'&Ic3/2s1CDDDDr%   c            
      X   \        R . R	ORRR^R^/4      p V P                  4       pV P                  RRR7      p\        P                  ! \        V R4      \        VR4      4      '       g   Q h\        P                  ! \        V R 4      \        VR 4      4      '       d   Q h^VP                  R
&   \        P                  ! W4       \        P                  ! \        V R4      \        VR4      4      '       d   Q h\        P                  ! \        V R4      \        VR4      4      '       g   Q hR# )r         ?r	         Y@r   dg     K@r   r
   Nr;   r   r   r   	r   r   r   r   r   r   r   r   r   r   r    r6   s      r#   (test_replace_mask_all_false_second_blockrB   U   s    	Cc5#q#qA	BBggiG
**4*
0C Ib#.	#s0CDDDD	"c 2Ic34GHHHHCGGFO"&	"c 2Ic34GHHHHIb#.	#s0CDDDDr%   c                     \        R . RORR/4      p V P                  4       pV P                  RR R7      p\        P                  ! \        V R4      \        VR4      4      '       g   Q h\        P                  ! \        V R 4      \        VR 4      4      '       d   Q hRVP                  R&   \        P                  ! W4       \        P                  ! \        V R4      \        VR4      4      '       d   Q hR# )	r   r;   r	   r<   r>         ?Nr?   r   r	   r@   rA   s      r#   !test_replace_coerce_single_columnrF   f   s    	Cc51	2BggiG
**3*
/CIb#.	#s0CDDDD	"c 2Ic34GHHHHCGGFO"&	"c 2Ic34GHHHHHr%   c                     \        R . RORR/4      p V P                  4       pV P                  RRR7      p\        P                  ! \        V R4      \        VR4      4      '       g   Q h\        P                  ! \        V R 4      \        VR 4      4      '       g   Q hRVP                  R	&   \        P                  ! W4       \        P                  ! \        V R4      \        VR4      4      '       d   Q hR# )
r   r;   r	   r<   xxxr>   rD   Nr?   rE   r@   rA   s      r#   #test_replace_to_replace_wrong_dtyperI   s   s    	Cc51	2BggiG
**S*
1CIb#.	#s0CDDDDIb#.	#s0CDDDDCGGFO"&	"c 2Ic34GHHHHHr%   c                  <   \        R . R
O/RR7      p \        V R 4      pV P                  R.R RR7       \        P                  ! VP
                  \        V R 4      P
                  4      '       g   Q hV P                  P                  ^ 4      '       g   Q hV P                  4       pV P                  R.R R7       V P                  R 4      p\        P                  ! VP
                  \        VR 4      P
                  4      '       d   Q h\        P                  ! W4       R	# )r   r	   r   categorydtypeTr
   r-   r
   c                 <    V P                   P                  R R/4      # )r	   r=   )catrename_categories)xs   &r#   <lambda>/test_replace_list_categorical.<locals>.<lambda>   s    QUU44c3Z@r%   Nr   r	   r   )r   r   r   r   r   codesr/   r0   r   applyr   r   r5   s       r#   test_replace_list_categoricalrY      s    	C)	<B
B
CJJuCJ.CIIyS'9'?'?@@@@77$$Q''''ggiGJJuCJ 
((@
AC		9S#+>+D+DEEEE"&r%   c                      \        R . RO/RR7      p V R,          pV P                  4       pV P                  R.R RR7       \        P                  ! W!4       R# )	r   r   rK   rL   r)   TrN   NrV   )r   r   r   r   r   r   r1   r    s      r#   *test_replace_list_inplace_refs_categoricalr\      sI    	C)	<Ba5DggiGJJuCJ.'(r%   r;   c                     \        R . RO/4      p\        VR 4      pVP                  RRRR7       \        P                  ! \        VR 4      V4      '       g   Q hVP
                  P                  ^ 4      '       g   Q hR# )r   r;         /@Tr   r
   r-   Nr?   r   r   r   r   r   r/   r0   )r   r   arr_as   &  r#   test_replace_inplacerb      sj    	C%	&Bb#EJJ#T4J8Ib#.666677$$Q''''r%   c                 T   \        R . RO/4      p\        VR 4      pVR,          pVP                  V RRR7       \        P                  ! \        VR 4      V4      '       d   Q hVP
                  P                  ^ 4      '       g   Q hVP
                  P                  ^ 4      '       g   Q hR# r   r)   r^   Tr_   Nr?   r`   r   r   ra   r1   s   &   r#   test_replace_inplace_referencerf      s    	C%	&Bb#Ea5DJJ*D$J?	"c 2E::::77$$Q''''99&&q))))r%   r<   c                 T   \        R . RO/4      p\        VR 4      pVR,          pVP                  V RRR7       \        P                  ! \        VR 4      V4      '       g   Q hVP
                  P                  ^ 4      '       d   Q hVP
                  P                  ^ 4      '       d   Q hR# rd   r`   re   s   &   r#   $test_replace_inplace_reference_no_oprh      s    	C%	&Bb#Ea5DJJ*D$J?Ib#.6666ww((++++yy**1-----r%   c                    \        R \        . RO4      /4      pVP                  4       p\        VR 4      pVR,          pVP	                  V ^RR7       \
        P                  ! \        VR 4      P                  VP                  4      '       d   Q hVP                  P                  ^ 4      '       g   Q hVP                  P                  ^ 4      '       g   Q h\        P                  ! WB4       R# )r   r)   Tr_   Nr   )r   r   r   r   r   r   r   rW   r/   r0   r   r   )r   r   r    ra   r1   s   &    r#   *test_replace_categorical_inplace_referencerj      s    	CY/0	1BggiGb#Ea5DJJ*AtJ<	"c 2 8 8%++FFFF77$$Q''''99&&q))))$(r%   c                     \        R \        . RO4      /4      p \        V R 4      pV P                  ^^RR7       \        P
                  ! \        V R 4      P                  VP                  4      '       g   Q hV P                  P                  ^ 4      '       g   Q h\        R \        . RO4      /4      p\        P                  ! W4       R# )r   Tr_   Nr   )r   r   r   r   r   r   rW   r/   r0   r   r   )r   ra   expecteds      r#    test_replace_categorical_inplacerm      s    	CY/0	1Bb#EJJ!1dJ3Ib#.44ekkBBBB77$$Q''''#{9567H"'r%   c                  r   \        R \        . RO4      /4      p V P                  4       pV P                  ^^R7      pV P                  P                  ^ 4      '       g   Q hVP                  P                  ^ 4      '       g   Q h\        P                  ! \        V R 4      P                  \        VR 4      P                  4      '       d   Q h\        P                  ! W4       \        VR 4      P                  pRVP                  R&   \        P                  ! \        VR 4      P                  V4      '       g   Q hR# )r   r>   g       @Nr   r   r   )r   r   r   r   r/   r0   r   r   r   rW   r   r   iloc)r   r    r6   ra   s       r#   test_replace_categoricalrq      s    	CY/0	1BggiG
***
+C77$$Q''''88%%a((((	"c 2 8 8)C:M:S:STTTT"&c3%%ECHHTNIc3/55u====r%   methodwheremaskc                    \        R . RO/4      pVP                  4       p\        VR 4      pVR,          p\        W4      p V ! VR ,          R8  RRR7       \        P
                  ! \        VR 4      V4      '       d   Q hVP                  P                  ^ 4      '       g   Q hVP                  P                  ^ 4      '       g   Q h\        P                  ! WB4       R# )r   r)   g?Tr-   Nr?   r   )
r   r   r   getattrr   r   r/   r0   r   r   )rr   r   r    ra   r1   s   &    r#   test_masking_inplacerx      s    	C%	&BggiGb#Ea5DR F
2c7S="d+	"c 2E::::77$$Q''''99&&q))))$(r%   c                     \        R ^^./4      p V P                  . . 4      p\        P                  ! \	        VR 4      \	        V R 4      4      '       g   Q hV P
                  P                  ^ 4      '       d   Q h\	        V R 4      pV P                  . . 4       \        P                  ! \	        V R 4      V4      '       g   Q hV P
                  P                  ^ 4      '       d   Q hVP
                  P                  ^ 4      '       d   Q hR# )r   N)r   r   r   r   r   r/   r0   )r   r6   ra   s      r#   test_replace_empty_listrz      s    	C!Q=	!B
**R
CIc3/2s1CDDDDww((++++b#EJJr2Ib#.6666ww((++++xx))!,,,,,r%   r=   c                 
   \        R . RO/\        R7      p\        VR 4      pVP                  R.V RR7       \        P
                  ! V\        VR 4      4      '       g   Q hVP                  P                  ^ 4      '       g   Q hR# )r   r   rL   Trv   NrV   )r   objectr   r   r   r   r/   r0   )r
   r   r"   s   &  r#    test_replace_object_list_inplacer}      sn    	C)	8B
B
CJJueTJ*C2s!3444477$$Q''''r%   c                      \        R . RO/4      p \        V R 4      pV P                  ^^.^RR7       \        P                  ! V\        V R 4      4      '       g   Q hV P
                  P                  ^ 4      '       g   Q hR# )r   Trv   Nr   r`   )r   r"   s     r#   +test_replace_list_multiple_elements_inplacer   	  sn    	C#	$B
B
CJJ1vq$J'C2s!3444477$$Q''''r%   c                     \        R . RO/4      p V P                  4       pV P                  R.RR7      p\        P                  ! W4       \
        P                  ! \        V R 4      \        VR 4      4      '       d   Q hV P                  . RORR7      p\        P                  ! W14       \        P                  ! \        V R 4      \        VR 4      4      '       g   Q hR# )r   r	   NrO   rV   )r=   ef)r   r   r   r   r   r   r   r   )r   r    r6   df3s       r#   test_replace_list_noner     s    	C)	*BggiG
**cU$*
'C"&	"c 2Ic34GHHHH **_D*
1C#'Ib#.	#s0CDDDDr%   c                  \   \        R . RO/4      p \        V R 4      pV P                  4       pV R,          pV P                  R .RRR7       V P                  P                  ^ 4      '       g   Q h\        P                  ! V\        V R 4      4      '       d   Q h\        P                  ! W#4       R# )r   r)   NTrN   rV   )
r   r   r   r   r/   r0   r   r   r   r   )r   r"   r    r1   s       r#   #test_replace_list_none_inplace_refsr   !  s    	C)	*B
B
CggiGa5DJJuD$J/77$$Q''''Yr3%78888'(r%   c                  :   \        R . ROR. RO/4      p V R,          pV P                  4       pV P                  R ^
/^dRR7       \        P                  ! \        VR 4      \        V R 4      4      '       g   Q h^dV P                  R&   \        P                  ! W4       R# )r   r	   r)   Trv   Nr   ro   	r   r   r   r   r   r   rp   r   r   r[   s      r#   %test_replace_columnwise_no_op_inplacer   ,  s    	CC3	4Ba5DggiGJJRy#tJ,IdC0)B2DEEEEBGGDM$(r%   c                  $   \        R . ROR. RO/4      p V P                  4       pV P                  R ^
/^d4      p\        P                  ! \        VR 4      \        V R 4      4      '       g   Q h^dVP                  R&   \        P                  ! W4       R# r   r	   Nr   ro   r   rA   s      r#   test_replace_columnwise_no_opr   6  sv    	CC3	4BggiG
**c2Y
$CIc3/2s1CDDDDCHHTN"&r%   c                     \        R ^\        P                  ^.R^/4      p V P                  4       p\        P
                  ! 4       ;_uu_ 4        V R ,          P                  ^^dRR7       RRR4       \        P                  ! W4       \        P
                  ! 4       ;_uu_ 4        V R .,          P                  ^^dRR7       RRR4       \        P                  ! W4       R#   + '       g   i     L; i  + '       g   i     L;; i)r   r	   Trv   N)r   r   nanr   r   raises_chained_assignment_errorr   r   )r   r    s     r#   test_replace_chained_assignmentr   ?  s    	C!RVVQa0	1BggiG		+	+	-	-
33- 
."&		+	+	-	-
C5	!S$/ 
."& 
.	- 
.	-s   C"%C5"C2	5D	c                     \        R . ROR. RO/4      p V P                  4       pV P                  ^^.^^.4      p\        P                  ! \        VR 4      \        V R 4      4      '       g   Q h^dVP                  R&   \        P                  ! W 4       V P                  ^^.^
^
.4      p\        P                  ! \        V R 4      \        VR 4      4      '       d   Q h\        P                  ! W4       R# r   r   )r   r    results      r#   test_replace_listliker   K  s    	CC3	4BggiGZZc
RH-FIfc2Ib#4FGGGGFKK"!ZZa2r(+F	"c 2Ifc4JKKKK"&r%   c                     \        R . ROR. RO/4      p \        V R 4      pV P                  ^^.^
^.RR7       \        P                  ! \        V R 4      V4      '       g   Q hV R,          pV P                  4       pV P                  ^^.^
^.RR7       \        P                  ! \        V R 4      V4      '       d   Q h\        P                  ! W#4       R# )r   r	   Trv   r)   Nr   )r   r   r   r   r   r   r   r   )r   r"   r1   r    s       r#   test_replace_listlike_inplacer   Z  s    	CC3	4B
B
CJJQx"b4J0Ib#.4444a5DggiGJJQx"b4J0	"c 2C8888$(r%   r   )'numpyr   pytestpandasr   r   pandas._testing_testingr   pandas.tests.copy_view.utilr   markparametrizer$   r2   r7   r9   rB   rF   rI   rY   r\   rb   rf   rh   rj   rm   rq   rx   rz   r}   r   r   r   r   r   r   r   r   r   r%   r#   <module>r      s      1 	QQ'"5	Qx"-	Qx"-	aV}%''*)
I
EE"
II' ) cUB'78( 9( cU|4* 5* U|4. 5. A3x0	) 1	)	(> GV#45) 6)
- 3+.( /((E ))'	''
)r%   