+
    xȇi                     "   ^ RI H t  ^ RIHt ^ RIt^ RIt^ RIHt ^ RIt	^ RIH
t
HtHtHtHtHtHtHt ^ RIHt ^ RIHt ]P.                  ! . R&OR7      R 4       tR	 t ! R
 R4      tR tR tR tR tR tR t R t!]PD                  PG                  RRR.4      R 4       t$R t%]PD                  PL                  ]! ]R7      R 4       4       t'R t(R t)R t*R t+]PD                  PG                  RRRR R] ! R!^^4      .4      R" 4       t,R# t-R$ t.R% t/R# )'    )datetime)givenN)	is_scalar)	DataFrameDatetimeIndexIndexSeriesStringDtype	Timestamp
date_rangeisna)OPTIONAL_ONE_OF_ALL)paramsc                    V P                   R 8X  d<   \        \        P                  P	                  ^4      P                  R4      . ROR7      # V P                   R8X  d   V# V P                   R8X  d   V# V P                   R8X  d   V# R# )defaultcolumnsfloat_stringmixed_float	mixed_intN      ABC)paramr   nprandomdefault_rngstandard_normal)requestfloat_string_framemixed_float_framemixed_int_frames   &&&&v/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/frame/indexing/test_where.pywhere_framer(      sw    }}	!II!!!$44V<o
 	
 }}&!!}}%  }}# $    c                 b   a R  o\        \        V3R lV P                  4        4       4      4      # )c                     \        V P                  P                  \        P                  \        P
                  34      ;'       d    V P                  R 8g  # )uint8)
issubclassdtypetyper   integerfloating)ss   &r'   is_ok_safe_add.<locals>.is_ok(   s7    qww||bjj"++%>?VVAGGwDV	
r)   c              3   ^   <"   T F"  w  rS! V4      '       d   W^,           3MW3x  K$  	  R# 5i)   N ).0cr2   r3   s   &  r'   	<genexpr>_safe_add.<locals>.<genexpr>-   s(     Ta1!e*qf<s   *-)r   dictitems)dfr3   s   &@r'   	_safe_addr?   &   s&    

 TTTTUUr)   c                     a  ] tR t^0t o R tR tR t]P                  P                  R4      R 4       t
R tR t]P                  P                  R]]]P"                  .4      R	 4       t]P                  P                  R
^.^ .^..]! ^.^.^..4      ]! R. R/O/4      R.R.R..]! R4      .]P.                  .]! R4      ...4      R 4       t]P                  P                  R
^ ^.^^ .^^..]! ^ ^.^^ .^^..4      RR.RR.RR..]! R. R/OR. R0O/4      ]P.                  ]! R4      .]! R4      ]P.                  .]! R4      ]! R4      ...4      R 4       tR tR tR tR tR tR tR t R 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*R( t+R) t,R* t-R+ t.]P                  P                  R,. R1O4      R- 4       t/R.t0V t1R&# )2TestDataFrameIndexingWherec                    RR lpTpWBJ d7   Rp\         P                  ! \        VR7      ;_uu_ 4        V^ 8   RRR4       R# V^ 8  pV! WF4       R#   + '       g   i     R# ; i)Tc           	         \        V 4      pV P                  W4      pV P                  VP                  V4      pVP                  4        F\  w  rg\	        \
        P                  ! W,          W,          W6,          4      VP                  R 7      p\        P                  ! WxRR7       K^  	  \        P                  ! WE4       V'       d2   VP                  V P                  8H  P                  4       '       g   Q hR# R# )indexF)check_namesN)r?   wherevaluesr=   r	   r   rE   tmassert_series_equalassert_frame_equaldtypesall)	r>   condcheck_dtypesother1rsrs2kvexps	   &&&      r'   
_check_get=TestDataFrameIndexingWhere.test_where_get.<locals>._check_get2   s    r]F$'B((4;;/C
RXXdgrufi@P&&q5A # !!"* 		RYY.335555 r)   I'>' not supported between instances of 'str' and 'int'|Invalid comparisonmatchNT)pytestraises	TypeError)selfr(   r$   rV   r>   msgrN   s   &&&    r'   test_where_get)TestDataFrameIndexingWhere.test_where_get1   s]    	6 #&  y44Q 5Av2	 54s   AA#	c                   \        R Uu/ uF  pV\        ^.^,          VR7      bK  	  up4      p^ VP                  R&   VP                  p\        \        P
                  ! R 4      \        P
                  ! R4      \        P
                  ! R4      \        P
                  ! R4      .. ROR7      p\        P                  ! W44       R# u upi )	float32float64int32int64r.   rD   N)rd   re   rf   rg   r6   NNN)r   r	   ilocrL   r   r.   rI   rJ   )r_   r9   r>   resultexpecteds   &    r'   test_where_upcasting/TestDataFrameIndexingWhere.test_where_upcastingL   s     BAA 61#'++A
 ##!!	 ;
 	v0+s   Cc                   R	R lpTpWBJ d7   Rp\         P                  ! \        VR7      ;_uu_ 4        V^ 8   RRR4       R# V^ 8  R,          pV! WF\        V4      4       V^ 8  pV! WF\        V4      P                  4       V^ 8  p\
        ;QJ d&    R VP                   4       F  '       d   K   RM	  R M! R VP                   4       4      pV! WF\        P                  VR7       R#   + '       g   i     R# ; i)
Tc                 p   V P                  W4      p\        VP                  4       EF/  w  rVWF,          pW,          P                  pW,          P	                  W,          P
                  4      P                  R 4      P                  p	\        V4      '       d   Tp
M]\        V\        P                  4      '       d,   \        VRV3,          VP
                  R7      P                  p
MW&,          P                  p
V	P                  4       '       d   TM\        P                   ! WV
4      p\        WP
                  VR7      p\        P                  ! W|R R7       EK2  	  V'       dT   \        V\        P                  4      '       g2   VP                  V P                  8H  P                  4       '       g   Q hR# R# R# )Frj   rD   )rE   name)check_dtypeN)rG   	enumerater   rH   reindexrE   fillnar   
isinstancer   ndarrayr	   rM   rI   rJ   rL   )r>   rN   otherrO   rQ   irS   rl   dr9   o
new_valuesrm   s   &&&&         r'   _check_alignETestDataFrameIndexingWhere.test_where_alignment.<locals>._check_alignh   s(   $&B!"**-ELLGOOBEKK077>EEU##Arzz22uQT{&,,?FFAA"#%%''Qrxxa/@
!*LLqI &&vUKK# ., Jubjj$A$A		RYY.335555 %B|r)   rX   rY   Nr6   NNc              3   t   "   T F.  p\        VP                  \        P                  4      '       * x  K0  	  R # 5i)N)r-   r/   r   r0   )r8   r2   s   & r'   r:   BTestDataFrameIndexingWhere.test_where_alignment.<locals>.<genexpr>   s%     Qy!z!&&"**===ys   68F)rO   r[   )	r\   r]   r^   r?   rH   rM   rL   r   nan)r_   r(   r$   r~   r>   r`   rN   rO   s   &&&     r'   test_where_alignment/TestDataFrameIndexingWhere.test_where_alignmentf   s    	66 #&  y44Q 5 Q|Ry}- AvR	" 4 46 AvsQryyQsssQryyQQRrvvLA 54s   C**C;	zignore::DeprecationWarningc                   \        \        P                  P                  ^4      P	                  R4      . ROR7      pV^ 8  pV^,           P
                  R	,          pRp\        P                  ! \        VR7      ;_uu_ 4        VP                  W#4       RRR4       VP                  R
,          P
                  p\        V4      pRp\        P                  ! \        VR7      ;_uu_ 4        VP                  WV4       RRR4       \        P                  ! \        VR7      ;_uu_ 4        VP                  R4       RRR4       \        P                  ! \        VR7      ;_uu_ 4        VP                  ^ 4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lv; i  + '       g   i     R# ; i)   r   z4other must be the same shape as self when an ndarrayrY   N,Array conditional must be same shape as selfTr   r   ):r   r   Nrj   )Nr   Nrj   )r   r   r    r!   r"   rH   r\   r]   
ValueErrorrG   rk   r?   mask)r_   r>   rN   err1r`   err2rP   s   &      r'   test_where_invalid-TestDataFrameIndexingWhere.test_where_invalid   s#    II!!!$44V<o
 AvQv&D]]:S11HHT  2 yy&&2<]]:S11HHT" 2 ]]:S11GGDM 2]]:S11GGAJ 21 21 21 21111s0   F)F'F'%F:F	F$	'F7	:G	c                :   RR lpTpWRJ d7   Rp\         P                  ! \        VR7      ;_uu_ 4        V^ 8   RRR4       R# WSJ d   VP                  R4      pV^ 8  pV! WW4       V^ 8  pV! WW4       V^ 8  R,          pV! WW4       R#   + '       g   i     R# ; i)Tc                 h   V P                  4       pVP                  V 4      P                  R 4      P                  4       pVP	                  V( 4      pVP                  V\        P                  R R7      pWcJ g   Q h\        P                  ! W54       V'       d   V P                  P                  4        Fz  w  rx\        VP                  \        P                  4      '       d3   W,          P                  4       '       g   \        P                   ! R4      pW7,          P                   V8X  d   Kz  Q h	  R# R# )Tinplacere   N)copyreindex_likerv   infer_objectsr   rG   r   r   rI   rK   rL   r=   r-   r/   r0   rM   r.   )	r>   rN   rO   dfiecondrm   rl   rS   rT   s	   &&&      r'   
_check_set=TestDataFrameIndexingWhere.test_where_set.<locals>._check_set   s    '')C%%b)006DDFExx'HYYtRVVTY:F= =!!#0 IIOO-DA!!&&"**55dgkkmmHHY/6<<1,,, . r)   rX   rY   Nre   r   r[   )r\   r]   r^   astype)r_   r(   r$   r&   r   r>   r`   rN   s   &&&&    r'   test_where_set)TestDataFrameIndexingWhere.test_where_set   s    	-  #&  y44Q 5 9%BAv2Qw2 a}2 54s   B		B	c           	        \        R \        ^4      R\        ^^4      /4      pVP                  VR ,          ^8H  4      pWR ,          ^8H  ,          P                  VP                  4      p\
        P                  ! W#4       R# )abN)r   rangerG   ru   rE   rI   rK   r_   r>   rl   rm   s   &   r'   test_where_series_slicing4TestDataFrameIndexingWhere.test_where_series_slicing   sd     U1XsE!QK89"S'Q,'gl#++BHH5
f/r)   klassc                p   \        R . RO/4      pR.R.R..p\        R \        P                  ^^./4      pVP                  V! V4      4      p\        P
                  ! WT4       ^VR&   ^\        P                  ^.VR&   RR.RR.RR..pVP                  V! V4      4      p\        P
                  ! WT4       R# )r   FTr   Nr6   r   r   )r   r   r   rG   rI   rK   )r_   r   r>   rN   rm   rl   s   &&    r'   test_where_array_like0TestDataFrameIndexingWhere.test_where_array_like   s     Y'($$(cBFFAq>23%+&
f/3BFFAe}tTl;%+&
f/r)   rN   r   TrueFalsez
2017-01-01z
2017-01-02c                    \        R . RO/4      pRp\        P                  ! \        VR7      ;_uu_ 4        VP	                  V4       RRR4       R#   + '       g   i     R# ; i)r   (Boolean array expected for the conditionrY   Nr   r   r\   r]   r^   rG   r_   rN   r>   r`   s   &&  r'   test_where_invalid_input_single:TestDataFrameIndexingWhere.test_where_invalid_input_single   sC     Y'(8]]9C00HHTN 1000s   AA#	r   z
2017-01-03c                    \        R . ROR. RO/4      pRp\        P                  ! \        VR7      ;_uu_ 4        VP	                  V4       RRR4       R#   + '       g   i     R# ; i)r   r   r   rY   Nr   )r   r   r   r   r   s   &&  r'   !test_where_invalid_input_multiple<TestDataFrameIndexingWhere.test_where_invalid_input_multiple  sG      YY788]]9C00HHTN 1000s   AA'	c                   \        . RO. RO.4      p\        . RO. RO.4      pVP                  V4      p\        R\        P                  ^.\        P                  \        P                  ^..4      p\        P
                  ! W44       . ROVn        VP                  V4      p\        \        P                  VP                  VP                  R7      p\        P
                  ! W44       R# )	r6         ?rE   r   Nr      r      )TFTFFT)r   r   r9   )r   rG   r   r   rI   rK   r   rE   )r_   r>   rN   rl   rm   s   &    r'   test_where_dataframe_col_match9TestDataFrameIndexingWhere.test_where_dataframe_col_match  s    	9-.-/CDE$sBFFA.0CDE
f/ '$RVV288RZZH
f/r)   c                X   R p\        . RO. RO.4      pR.p\        P                  ! \        VR7      ;_uu_ 4        VP	                  V4       RRR4       \        . RO\
        P                  \
        P                  \
        P                  ..4      pVP	                  \        V4      4      p\        P                  ! WT4       \
        P                  ! . RO4      p\        P                  ! \        VR7      ;_uu_ 4        VP	                  V4       RRR4       \        \
        P                  \
        P                  \
        P                  .. RO.4      pVP	                  \        V4      4      p\        P                  ! WT4       R#   + '       g   i     ELA; i  + '       g   i     L; i)r   TrY   Nr   r   )FTFT)r   r\   r]   r   rG   r   r   r	   rI   rK   array)r_   r`   r>   rN   rm   outs   &     r'   test_where_ndframe_align3TestDataFrameIndexingWhere.test_where_ndframe_align+  s   <	9-.v]]:S11HHTN 2 i"&&"&&"&&)ABChhvd|$
c,xx23]]:S11HHTN 2 rvvrvvrvv6	BChhvd|$
c, 211 21s   F=FF	F)	c           	     4   \        R . R	OR. R
O/RR7      p\        R \        P                  \        P                  RR.RRR\        P                  \        P                  ./RR7      pVP                  4       pVP	                  V^8  \        P                  4      p\
        P                  ! WB4       \
        P                  ! W14       VP                  4       pVP	                  V^8  \        P                  RR7      pWCJ g   Q h\
        P                  ! W24       R# )r         @      @r   re   rh   Tr   N)r          @r   r   r   r   r   r   )r   r   r   r   rG   rI   rK   )r_   df_origrm   r>   rl   s   &    r'   test_where_bug)TestDataFrameIndexingWhere.test_where_bugA  s    &-AB)
 2662663,cCbffbff3MN

 \\^"q&"&&)
f/
b*\\^"q&"&&$7||
b+r)   c           
        \        R \        P                  ! . ROVR7      R\        P                  ! . RORR7      /4      p\        R . R
OR. RO/4      P                  R VRR/4      pVP	                  4       pVP                  V^8  R	4      p\        P                  ! WS4       \        P                  ! WB4       VP	                  4       pVP                  V^8  R	RR7      pWTJ g   Q h\        P                  ! WC4       R# )r   rh   r   re   Tr   Nr6   r   r   r   r   )r   r   r   r   )r   r   r   r   )r   r   r   r   r   rG   rI   rK   )r_   any_signed_int_numpy_dtyper   rm   r>   rl   s   &&    r'   test_where_bug_mixed/TestDataFrameIndexingWhere.test_where_bug_mixedU  s    RXXl2LMRXX2)D
 .#'9:

&#13	B
C 	 \\^"q&"%
f/
b*\\^"q&"d3||
b+r)   c           	        \        ^ ^^.^^^.^^^./4      p\        ^ \        P                  ^.^^	\        P                  .^\        P                  \        P                  ./4      pVP                  4       W8  ,          pVP	                  4       pW$V( &   V^ ^.,          P                  R4      V^ ^.&   VP                  W24      p\        P                  ! WT4       \        ^ ^^.^^^ ./4      p\        ^ \        P                  ^.^^\        P                  ./4      pVP                  4       W8  ,          pVP	                  4       pW$V( &   V^,          P                  R4      V^&   VP                  W24      p\        P                  ! WT4       R# )r   re   N)	r   r   r   r   r   r   rG   rI   rK   )r_   r   r   do_not_replacerm   rl   s   &     r'   test_where_bug_transposition7TestDataFrameIndexingWhere.test_where_bug_transpositionl  sW   q1a&!aVQA78q2661+q1bff+q266266:JKLQU+668$%.!#QF+229=!Q+
f/q1a&!aV,-q2661+q1bff+67QU+668$%.!qk((3+
f/r)   c           
     Z   \        R \        R^R7      R\        R^R7      R\        P                  P	                  ^4      P                  ^4      /4      p\        R^^4      pRp\        P                  ! \        VR7      ;_uu_ 4        W8   R	R	R	4       WP                  R
R	R13,          V8  ,          pVP                  4       p\        P                  VP                  ^ ^.R 3&   \        P                  VP                  R&   \        P                  ! WE4       R	#   + '       g   i     L; i)r   20130102periodsr   20130104r   i  zF'>' not supported between instances of 'float' and 'datetime.datetime'rY   Nrj   r   )rj   r   )r   r   r   r    r!   r"   r   r\   r]   r^   rk   r   r   locrI   rK   )r_   r>   stampr`   rl   rm   s   &     r'   test_where_datetime.TestDataFrameIndexingWhere.test_where_datetime  s    Z
A6Z
A6RYY**1-==a@
 q!$V]]9C00J 1 GGAssFOe+,779$&FFaVS[!!vvV
f/ 10s   DD*	c                   \        R \        \        ^
4      4      /4      P                  \        4      pRW^8  &   \        R \        ^ ^^^^^^^\
        P                  \
        P                  .
4      /4      p\        P                  ! W4       \        R^R\
        P                  RR/R\
        P                  RRR\
        P                  /.4      pVP                  4       p\        V4      ( pVP                  VRRR7       \        RR\
        P                  .RRR.RRR./4      p\        P                  ! W4       VP                  4       pRW( &   \        P                  ! W4       R# )	seriesNr   r   r   TestTr   r   )r   r	   r   r   floatr   r   rI   rK   r   r   rG   )r_   r>   rm   origr   s   &    r'   test_where_none*TestDataFrameIndexingWhere.test_where_none  s=    &r"345<<UC6
vq!Q1aArvvrvvFGH
 	b+ abffc62bffc637
 wwyRy
tT*c266]dF^fd^
 	b+YY[5	
b+r)   c                    \        R .R7      pTpVP                  \        8H  P                  4       '       g   Q hVP	                  V4      p\
        P                  ! W14       R# )r   r   N)r   rL   objectrM   rG   rI   rK   )r_   r>   rN   rl   s   &   r'   9test_where_empty_df_and_empty_cond_having_non_bool_dtypesTTestDataFrameIndexingWhere.test_where_empty_df_and_empty_cond_having_non_bool_dtypes  sL    u%v%**,,,,$
f)r)   c           	        R  pV! 4       pVP                  VP                  4       4      pVP                  \        P                  ! V4      VP                  4       RR7      p\
        P                  ! WC4       VP                  \        P                  ! V4      VP                  4       RRR7      pWBJ g   Q h\
        P                  ! W#4       V! 4       P                  ^ 4      pVP                  R V^ ,          R7      pVP                  V^ 8  V^ ,          RR7      p\
        P                  ! WC4       VP                  V^ 8  V^ ,          RR7      p\
        P                  ! WC4       V! 4       pVP                  ^4      pVP                  \        P                  ! V4      \        ^VP                  VP                  R	7      4      p\
        P                  ! WC4       R
# )c                  "   \        \        P                  P                  ^4      P	                  R4      4      p \        P
                  V P                  R&   \        P
                  V P                  R&   \        P
                  V P                  R&   V # )r   )
   r   ):r   r   Nr   ):r   r   Nr6   ):r      Nr   )r   r   r    r!   r"   r   rk   )r>   s    r'   create;TestDataFrameIndexingWhere.test_where_align.<locals>.create  s^    299003CCGLMB ffBGGFO ffBGGFO ffBGGFOIr)   r   axisTr   r   c                 ,    V P                  V ^ 8  V4      # )r   )rG   )xys   &&r'   <lambda>=TestDataFrameIndexingWhere.test_where_align.<locals>.<lambda>  s    Q):r)   r   rE   rowsr   N)rv   meanrG   pdnotnarI   rK   applyr   rE   r   )r_   r   r>   rm   rl   s   &    r'   test_where_align+TestDataFrameIndexingWhere.test_where_align  s]   	 X99RWWY'"((2,		B
f/"((2,	4iP||
b+X__Q88:be8D"q&"Q%g6
f/"q&"Q%f5
f/ X99Q<HHRL)ARXXrzzJ
 	f/r)   c                    \        R^.\        P                  R..RR.R7      p\        R^.RR..RR.R7      p\        P                  W"P                  4       ^8  &   \        P
                  ! W!4       R# )r6   r   r   r   Ny      ?      ?y      @      ?y      @      ?)r   r   r   absrI   rK   )r_   rm   r>   s   &  r'   test_where_complex-TestDataFrameIndexingWhere.test_where_complex  sf    vqkBFFF+;<sCjQff%56c
KFF668q=
b+r)   c                   \        \        P                  P                  ^4      P	                  R
4      4      p\        RR.RR..4      p\        ^ ^.4      pVP                  4       p\        ^ ^ .^^..RR7      pVP                  W#RR7      p\        P                  ! We4       VP                  4       pVP                  W#RRR7      pWdJ g   Q h\        P                  ! We4       VP                  4       p\        ^ ^.^ ^..RR7      pVP                  W#RR7      p\        P                  ! We4       VP                  4       pVP                  4       pVP                  W#RRR7      pWdJ g   Q h\        P                  ! WE4       R	# )r   Fre   rh   rE   r   Tr   r   r   N)r   r   )
r   r   r    r!   r"   r	   r   rG   rI   rK   )r_   r   r   serr>   rm   rl   s   &      r'   test_where_axis*TestDataFrameIndexingWhere.test_where_axis  sK   BII11!4DDVLM5%.5%.9:aVn\\^q!fq!f-Y?$'2
f/\\^$'4@||
f/\\^q!fq!f-Y?$)4
f/\\^$)TB||
b+r)   c           	     R   \        ^^.^^..RR7      p\        RR.RR..4      p\        ^ \        P                  .4      p\        ^ ^ .\        P                  \        P                  ..RR7      pVP	                  W#RR7      p\
        P                  ! WT4       VP                  4       p\        P                  ! \        RR7      ;_uu_ 4        VP	                  W#RR	R
7       RRR4       \        ^ \        P                  .^ \        P                  ..4      pVP	                  W#RR7      p\
        P                  ! WT4       \        P                  ! \        RR7      ;_uu_ 4        VP	                  W#RR	R
7       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r6   rg   rh   Fre   rE   r   Invalid valuerY   Tr  Nr   )r   r	   r   r   rG   rI   rK   r   r\   r]   r^   )r_   r>   r   r  rm   rl   s   &     r'   test_where_axis_with_upcast6TestDataFrameIndexingWhere.test_where_axis_with_upcast
  s:   AA'w75%.5%.9:a[!q!frvvrvv&67yI$'2
f/]]9O<<LL$L? = q"&&kArvv;78$)4
f/]]9O<<HHTYH= =< =< =<<s   F#FF	F&	c                L
   \         P                  ! \        \        P                  P                  ^4      P                  R4      4      \        \        P                  P                  ^4      P                  ^ ^
RR7      RR7      .R^R7      p\        RVP                  VP                  R7      p\        ^VP                  R7      p\        ^VP                  R7      pVP                  4       pVP                  W#R	R
7      p\        RVP                  VP                  R7      pV^,          P                  R4      V^&   V^,          P                  R4      V^&   \        P                  ! Wg4       VP                  4       pVP                  W#R	RR7      pWeJ g   Q h\        P                  ! WW4       VP                  4       pVP                  W$RR
7      p\        RVP                  VP                  R7      pV^,          P                  R4      V^&   V^,          P                  R4      V^&   \        P                  ! Wg4       VP                  4       pVP                  W$RRR7      pWeJ g   Q h\        P                  ! WW4       VP                  4       P!                  ^^ R
7      pVP                  4       P                  R4      p\        P"                  VP$                  R&   VP                  4       pVP                  W(4      p\        P                  ! Wg4       VP                  W(RR
7      p\        P                  ! Wg4       VP                  4       p\&        P(                  ! \*        RR7      ;_uu_ 4        VP                  W(RR7       RRR4       \&        P(                  ! \*        RR7      ;_uu_ 4        VP                  W(RRR7       RRR4       VP                  4       P!                  ^^R
7      p	VP                  4       p\        P"                  VP$                  R&   VP                  4       pVP                  W)4      p\        P                  ! Wg4       VP                  W)R	R
7      p\        P                  ! Wg4       VP                  4       pVP                  W)RR7      pWeJ g   Q h\        P                  ! WW4       VP                  4       pVP                  W)RR	R7      pWeJ g   Q h\        P                  ! WW4       R#   + '       g   i     EL; i  + '       g   i     ELV; i)r   )sizerg   rh   T)ignore_indexr   F)r   rE   rD   r   r   r   r  rE   r   r   r	  rY   r   Nr   )r   r   ri   rj   r6   )r   concatr   r   r    r!   r"   integersr   rE   r	   r   rG   r   rI   rK   dropr   r   r\   r]   r^   )
r_   r   r   s1s2r>   rl   rm   d1d2s
   &         r'   test_where_axis_multiple_dtypes:TestDataFrameIndexingWhere.test_where_axis_multiple_dtypes  s   ))"))//2BB7KLII))!,55a'5J! 

 w}}MAW__-AW]]+\\^$3S'//Oqk((1qk((1
f/\\^$DA||
b+\\^$1S'//Oqk((1qk((1
f/\\^$$?||
b+ \\^   +<<>((1VVT\\^$#
f/$1
f/\\^]]9O<<HHTtH, =]]9O<<HHTt'H: = \\^   +<<>VVT\\^$#
f/$3
f/\\^$D1||
b+\\^$DyA||
b++ =<<<<<s   0S>0T>T	T#	c                   \        . RO. R	O. R
O.4      pVP                  R R 4      p\        . RO. RO. R
O.4      p\        P                  ! W#4       \        P                  ! W!P                  V^8  V^,           4      4       VP                  R R 4      p\        . RO. RO. RO.4      p\        P                  ! W#4       \        P                  ! W!P                  V^,          ^ 8H  ^c4      4       V^,           P                  R R 4      p\        . RO. RO. RO.4      p\        P                  ! W#4       \        P                  ! W!^,           P                  V^,           ^8  V^,           ^
,           4      4       R# )r6   c                     V ^8  # )r   r7   r   s   &r'   r   @TestDataFrameIndexingWhere.test_where_callable.<locals>.<lambda>n  s    AEr)   c                     V ^,           # r6   r7   r  s   &r'   r   r  n  s    QUr)   c                 .    V ^,          ^ 8H  P                   # )r   )rH   r  s   &r'   r   r  t  s    QUaZ$7$7r)   c                     ^c# )c   r7   r  s   &r'   r   r  t  s    2r)   c                     V ^8  # )r   r7   r  s   &r'   r   r  z  s    !a%r)   c                     V ^
,           # )r   r7   r  s   &r'   r   r  z  s    1r6r)   Nr   r   )   r   	   )r   r   r   )r   r   r   )r!  r   r!  )r   r!  r   )r!  r   r!  )         )         )r%  r      )r   rG   rI   rK   )r_   r>   rl   rU   s   &   r'   test_where_callable.TestDataFrameIndexingWhere.test_where_callablek  s   	9i89/?;Iy9:
f*
fhhrAvrAv&>? 7Fj+>?
f*
fhhrAv{B&?@ q&1AB|[AB
f*
fAvnnb1f\BFb=&QRr)   c                r   \        \        . ROVR7      R.R7      p\        \        . ROVR7      R.R7      p\        . ROR.R7      p\        \        . ROVR7      R.R7      pV\        J d%   VR,          pVR,          pVR,          pVR,          pVP                  WT4      p\        P
                  ! Wg4       R# )	20150101)tzdater   N)r0  2015010220150103)r4  2015010420150105TTF)r0  r3  r6  )r   r   r	   rG   rI   assert_equal)r_   tz_naive_fixtureframe_or_seriesobj1obj2r   rU   rl   s   &&&     r'   test_where_tz_values/TestDataFrameIndexingWhere.test_where_tz_values  s    >CSTH
 >CSTH
 ,vh?>CSTH
 f$<D<D<Df+CD'
$r)   c                   \        \        P                  ! ^4      P                  ^^4      \	        R4      R7      p\        P
                  ! . RO. RO.4      pVP                  V4      p\        ^ \        P                  \        P                  .\        P                  \        P                  ^..\	        R4      R7      p\        P                  ! W44       R# )r   ABCr   NTFFr   )
r   r   arangereshapelistr   rG   r   rI   rK   )r_   r>   r   rl   rm   s   &    r'   test_df_where_change_dtype5TestDataFrameIndexingWhere.test_df_where_change_dtype  s    ryy'//15tE{Kxx-/CDE$ 2662661"56U
 	f/r)   kwargsry   Nc                   \         P                  ! ^\         P                  R7      P                  ^^4      p\	        V\        R4      R7      p\         P                  ! . RO. RO.4      pVP                  P                  R4      Vn        VP                  P                  R4      Vn	        VP                  P                  R4      Vn
        VP                  ! V3/ VB p\        P                  ! ^ \         P                  .^ ^.R7      p\        P                  ! \         P                  \         P                  .^^.R7      p\        P                  ! \         P                  ^.^^.R7      p\	        RVRVRV/4      p	\        P                   ! WY4       VP                  P                  ! VR,          3/ VB p\#        VRR	7      p	\        P$                  ! WY4       R
# )r   rh   r@  r   category)
categoriesr   r   r   )rr   NrA  r   rj   r   )r   rB  rg   rC  r   rD  r   r   r   r   r   rG   r   Categoricalr   rI   rK   r	   rJ   )
r_   rG  datar>   r   rl   r   r   r   rm   s
   &&        r'   test_df_where_with_category6TestDataFrameIndexingWhere.test_df_where_with_category  sP    yybhh/771=tT%[1xx-/CDE tt{{:&tt{{:&tt{{:&$)&)NNArvv;Aq6:NNBFFBFF+A?NNBFFA;Aq6:c1c1c156
f/ DJ1&1!#&
v0r)   c                D   \        ^ ^ .^^..RR.R7      pVR,          P                  R4      VR&   VP                  VR,          ^ 8  4      pVP                  4       P                  RR/4      p\        P
                  VP                  R&   \        P                  ! W#4       R# )r   r   r   rM  r   rI  r   N)r   rj   )	r   r   rG   r   r   r   r   rI   r8  r   s   &   r'    test_where_categorical_filtering;TestDataFrameIndexingWhere.test_where_categorical_filtering  s    aVaV,sCjAS'..,3"S'A+&779##S'N3VVT
)r)   c                ~   \        R . ROR. RO/4      p\        P                  ! ^\        P                  ^	.4      p\	        V4      p\
        P                  ! VP                  \        R7      pRVR&   VP                  WC^ R7      p\        R ^\        P                  ^.R^\        P                  ^./RR7      p\        P                  ! WV4       \	        VR,          R R.R7      p\        R . ROR^\        P                  ^./4      pVR,          P                  R4      VR&   VP                  WG^R7      p	\        P                  ! W4       VP                  4       p
V
P                  WC^ RR	7       \        P                  ! W4       VP                  4       pVP                  WG^RR	7       \        P                  ! W4       R
# )r   r   rh   Fr   Int64r   rD   Tr  Nr   r   ri   )r6   r$  r   )r   r   r   NAr	   r   onesshapeboolrG   rI   rK   r   r   r   )r_   r>   arrr  r   result1	expected1ser2	expected2result2result3result4s   &           r'   test_where_ea_other.TestDataFrameIndexingWhere.test_where_ea_other  s[   YY78hh255!}%Skwwrxxt,T
((41(-sQqM3BEE1FgV	
g1c"gc3Z0sIsQqMBC	"3..w7	#((4A(.
g1'')TQ5
g1'')Ta6
g1r)   c                .   \        \        P                  ! ^ ^ 4      .4      pVP                  VP	                  4       4      p\
        P                  ! W!4       V^ ,          pVP                  VP	                  4       4      p\
        P                  ! W#4       R# )r   N)r   r   IntervalrG   r   rI   rK   rJ   )r_   r>   resr  s   &   r'   test_where_interval_noop3TestDataFrameIndexingWhere.test_where_interval_noop  sg    Aq)*+hhrxxz"
c&eii		$
s(r)   c                   V! \         P                  ! ^ ^ 4      .^,          4      pV! RR.\        R7      pVP                  VP	                  4       ( V4      p\
        P                  ! WC4       \        P                  ! \        RR7      ;_uu_ 4        VP                  VP	                  4       VRR7       RRR4       R#   + '       g   i     R# ; i)	r   r   r   rh   r	  rY   Tr   N)r   re  r   rG   r   rI   r8  r\   r]   r^   r   )r_   r:  objry   rf  s   &&   r'   #test_where_interval_fullop_downcast>TestDataFrameIndexingWhere.test_where_interval_fullop_downcast  s    r{{1a01A56c
&9iie,
#]]9O<<HHSYY[%H6 =<<<s   #B>>C	r.   c                   \        \        P                  ! ^4      R,          \        P                  R7      P	                  V4      pVP                  4       p\        P                  ! . R	O4      pVP                  V( R4      p\        P                  ! WR4       VP                  R
^4      pVP                  V( R4      p\        P                  ! Ws4       VP                  VR4      p\        P                  ! W4       VP                  VR4      p	\        P                  ! W4       \        P                  ! \        RR7      ;_uu_ 4        VP                  V( ^RR7       RRR4       R#   + '       g   i     R# ; i)r   rh   foor	  rY   Tr   Ni ʚ;FFFr   )r	   r   rB  rg   r   to_framer   rG   rI   rJ   rC  rK   r   r\   r]   r^   )
r_   r.   r  r>   r   rf  mask2res2res3res4s
   &&        r'   test_where_datetimelike_noop7TestDataFrameIndexingWhere.test_where_datetimelike_noop  s    RYYq\E):AA%H\\^xx-.iiu%
s(R#xx&
d'xxe$
t)wwue$
d' ]]9O<<GGUFAtG, =<<<s   E&&E7	r7   )r   r   r$  )r   r   r%  )ztimedelta64[ns]zdatetime64[ns]zdatetime64[ns, Asia/Tokyo])2__name__
__module____qualname____firstlineno__ra   rn   r   r\   markfilterwarningsr   r   r   parametrizerD  tupler   r   r   r	   r   r   r   NaTr   r   r   r   r   r   r   r   r   r   r   r  r  r
  r  r-  r=  rE  rN  rR  rb  rg  rk  ru  __static_attributes____classdictcell__)__classdict__s   @r'   rA   rA   0   s    6142Bj [[ <= >.'R0 [[WtUBHH&=>0 ?0  [[S1#sOQC!qc?#sI&'Xy6(+%&9\3J2KL	
		 [[VaVaV$QFQFQF+,v 1FF3CDsIsI67<01<("&&1<()L*AB
	
0-,,(,.000.!,F*0B,,6>*J,XS(%.
0 [[XWdO'<=1 >12
*24)7 [[	
--r)   rA   c            
         \         P                  ! ^4      P                  \         P                  4      P	                  ^^4      p \        V 4      p\         P                  ! V P                  \        R7      pRVR&   VP                  VR4      p\        ^ V R,          ^\         P                  ! R.^,          \         P                  R7      /4      p\        P                  ! W44       R# )r   rh   TNrK  i   )r   rB  r   int16rC  r   zerosrX  rY  rG   r   rf   rI   rK   )rZ  r>   r   rf  rm   s        r'   %test_where_int_downcasting_deprecatedr    s    
))A,

bhh
'
/
/1
5C	3B88CIIT*DDJ
((4
C!SY288UGaKrxx+PQRH#(r)   c                 6   V ! . RO4      pVP                  4       pV \        J d
   V^ ,          MTpVP                  V^8  4      pV^,          p\        P                  ! W4       VP                  V^8  . RO4      pV^,          p\        P                  ! W4       R# )r6   Nr   )r   r   rG   rI   r8  )r:  rl   rm   col	where_ress   &    r'   test_where_copies_with_noopr  &  sy    \*F{{}H&)3&)CS1W%INIOOF%S1Wl3INIOOF%r)   c                    V ! . R	O. R
O\        4       R7      pV ! RR.RR.\        4       R7      p\        . RO4      pVP                  W24      pV ! \        P                  RR\        P                  .. R
O\        4       R7      p\
        P                  ! WE4       VP                  V( V4      p\
        P                  ! WE4       VP                  V( VRR7       \
        P                  ! WE4       R# )r   r   r9   id2id3)rE   r.   Tr   N)r   r   r9   r{   )id1r  r  id4)FTTF)r
   r	   rG   r   rV  rI   r8  r   )r:  rj  filtered_obj
filter_serrl   rm   s   &     r'   test_where_string_dtyper  7  s    
$@C #	c
5%.L 23JYYz0F	S"%% *mH
 OOF%XXzk<0FOOF%HHj[,H5OOF%r)   c                  r   \        R R.^,          RR.^,          R. RO/4      p V P                  V R8H  4      p\        R \        P                  ! \        P                  .^,          \
        R7      RR.^,          R\        P                  R\        P                  R./4      p\        P                  ! W4       R# )AAATBBBFCCCrh   N)TFTF)r   rG   r   r   r   r   rI   rK   )df_maskrl   rm   s      r'   test_where_bool_comparisonr  P  s    	
EE7Q;7QRG ]]7e+,F288RVVHqL7E7Q;BFFE26651	
H &+r)   c                      \        R \        R4      \        P                  \        R4      .R^^\        P
                  ./4      p V P                  V P                  4       R4      p\        P                  ! W4       R# )r   2013010120130103r   N)
r   r   r   r  r   r   rG   notnullrI   rK   )rm   rl   s     r'   test_where_none_nan_coercer  `  sc    )J':1FG!Q	
H ^^H,,.5F&+r)   c                     \        ^ \        P                  ..\        RR.4      R7      p V P                  w  r\        RR..W!R7      pV P                  \        4      P                  V4      pV P                  R4      P                  V4      pV P                  P                  VP                  4      P                  pV P                  V4      p\        P                  ! VP                  R4      VP                  R4      4       \        P                  ! VP                  R4      VP                  R4      4       \        P                  ! VP                  R4      VP                  R4      4       R# )r   r   rQ  T)rM  r   rE   f8N)r   r   r   r   axesr   r   rG   TrI   rK   )rl   rE   r   r   r   r   r9   r{   s           r'   &test_where_duplicate_axes_mixed_dtypesr  l  s     a[M5#s3DEF[[NED$<.'GDf##D)Ad!!$'Atvv  ATA!((4.!((4.9!((4.!((4.9!((4.!((4.9r)   c                      \        R RR.R^\        P                  ./4      p V P                  4       pV P	                  \
        P                  ! V 4      R4      p\        P                  ! W4       R# )r   r   r   r   N)	r   r   r   r   rG   r   r  rI   rK   )r>   rm   rl   s      r'   test_where_columns_castingr  {  sT     
C#sS1bff+6	7BwwyHXXbjjnd+F(+r)   as_catTFc                    \         P                  ! R ^RR7      pV'       d   VP                  R4      pV ! V4      p\         P                  P	                  R4      p\
        P                  ! . ROVP                  R7      P                  pV'       d   RpMRpV'       d   \        P                  ! \        VR	7      ;_uu_ 4        VP                  We4       R
R
R
4       \        P                  ! \        VR	7      ;_uu_ 4        VP                  We4       R
R
R
4       \        P                  ! \        VR	7      ;_uu_ 4        VP                  WeRR7       R
R
R
4       R
# VP                  \        4      P                  We4      pVP                  We4      p	\        P                   ! W4       VP                  \        4      P                  We4      pVP                  We4      p	\        P                   ! W4       \        P                  ! \        RR	7      ;_uu_ 4        VP                  WeRR7       R
R
R
4       R
#   + '       g   i     ELi; i  + '       g   i     EL?; i  + '       g   i     R
# ; i  + '       g   i     R
# ; i)
2016-01-01D)r   freqrI  m8[ns]TndminzUCannot setitem on a Categorical with a new category \(NaT\), set the categories firstzvalue should be a 'Period'rY   Nr   r	  r7  )r   period_ranger   r  to_numpyr   r   ndimr  r\   r]   r^   rG   r   r   rI   r8  )
r:  r  r#   idxrj  tdnatr   r`   rm   rl   s
   &&&       r'   test_where_period_invalid_nar    s    //,
<Cjj$
#
C FFOOH%E88'sxx8::D' 	
 +]]9C00IId" 1 ]]9C00HHT! 1 ]]9C00HHT$H/ 10 ::f%++D84'
)::f%**47$&
)]]9O<<HHT$H/ =<) 100 100 100 =<<s0   H3?I=II/3I	I	I,	/J 	c                 B   \         P                  ! . ROVR7      pV ! V4      p\        P                  ! . ROVP                  R7      P                  pRp. \
        P                  O\         P                  N F  p\        P                  ! \        VR7      ;_uu_ 4        VP                  WF4       RRR4       \        P                  ! \        VR7      ;_uu_ 4        VP                  WF4       RRR4       K  	  R#   + '       g   i     LT; i  + '       g   i     K  ; i)r6   rh   r  z3Invalid value '.*' for dtype '(U?Int|Float)\d{1,2}'rY   Nr   r7  )r   r   r   r  r  rI   NP_NAT_OBJECTSr  r\   r]   r^   rG   r   )r:  any_numeric_ea_dtyperZ  rj  r   r`   nulls   &&     r'   test_where_nullable_invalid_nar    s    
((9$8
9C
#
C88'sxx8::D
@C,"##,RVV,]]9C00IId! 1 ]]9C00HHT  10 -00 100s   C:D:D
D)rM  c                    \        R V /4      pVP                  \        P                  ! V4      R4      P	                  4       pVP                  \        P                  ! V4      RRR7       \
        P                  ! W4       R# )r   NTr   )r   rG   r   r  r   rI   r8  )rM  r>   df_copys   &  r'   test_where_inplace_castingr    sY     
C;	Bhhrzz"~t,113GHHRZZ^T4H0OOB r)   c                     \        . RO4      p \        P                  ! . RO4      p\        P                  ! ^R7      p\        W"V.RR7      pV P                  W4      pVP                  \        4      p\        P                  ! WE4       R# )r6   )daysr  rh   Nr   ro  )
r	   r   r   r   	TimedeltarG   r   r   rI   rJ   )r  r   tdrm   rr  r^  s         r'   test_where_downcast_to_td64r    sc    

C88)*D	1	Brrl(3H99TD'I4+r)   c                    V P                  W4      p\        P                  ! WC4       V P                  V( V4      p\        P                  ! WC4       V P	                  4       p V P                  V( VR R7       VP                  4       '       g0   VP	                  4       pVR,          P                  \        4      VR&   \        P                  ! W4       R# )Tr   r   N)rG   rI   rK   r   r   rM   r   r   )r>   r   ry   rm   rf  s   &&&& r'   _check_where_equivalencesr    s     ((4
C#(
''4%
C#(
 
BGGTE5$G'88::==? ,,V4"'r)   c            	      Z   \        R ^R7      p V P                  P                  ^^4      pWR,          ,
          p\        VRR.R7      p\        P
                  ! VP                  4       4      P                  4       pRVR&   RVR&   \        R\        P                  ! VR,          VR,          VR,          .\        R7      RVR,          /4      p\        P                  ! \        RR	7      ;_uu_ 4        \        W4W%4       R
R
R
4       RVR&   Tp\        W4W%4       R
#   + '       g   i     L%; i)r  r   r   r   r   Trj   rh   r	  rY   N)r   r   r  )r6   r   )r   r   )r   _datarC  r   r   asarrayr   r   r   r   r\   r]   r^   r  )dtidtary   r>   r   rm   s         r'   test_where_dt64_2dr    s    
\1
-C
))

Aq
!Cd)OE	3c
	+B::bggi %%'DDJ DJ5;D	5;?vNT	
H 
y	8	8!"E< 
9 DGHb8 
9	8s   0DD*	c                  D   \        R \        ^\        P                  ^.RR7      R. RO/4      p V P	                  R 4      p\        R \        \        P                  \        P                  ^.RR7      R\
        P                  ^^./4      p\        P                  ! W4       R# )r   rU  rh   r   c                 *    V P                  R  ^R7      # )c                     V ^8  # r  r7   r   s   &r'   r   Mtest_where_producing_ea_cond_for_np_dtype.<locals>.<lambda>.<locals>.<lambda>  s    !a%r)   r   )r   r  s   &r'   r   ;test_where_producing_ea_cond_for_np_dtype.<locals>.<lambda>  s    a @r)   Nr   )	r   r	   r   rV  rG   r   r   rI   rK   )r>   rl   rm   s      r'   )test_where_producing_ea_cond_for_np_dtyper    s{    	CBEE1W=sIN	OBXX@AF	fbeeRUUA&g6bffa^LH &+r)   replacementgMbP?snakei  c                     \        . RO\        P                  RR..4      pVP                  \        P
                  ! V4      V 4      p\        . ROV RV ..4      p\        P                  ! W#4       R# )r   g?N)r   g(,*0Enine)r   r   r   rG   r   r  rI   rK   )r  r>   rl   rm   s   &   r'   test_where_int_overflowr    s\    
 
'"&&#t)<=	>BXXbjjnk2F-S+/NOPH&+r)   c                     \        R RR.RRR./4      p \        R RR.RRR./4      pV P                  VRR7      pW J g   Q h\        R ^\        P                  .R\        P                  R./4      p\        P
                  ! W4       R	# )
r   r   r   r   r   r   TFr   N)r   rG   r   r   rI   rK   )r>   rN   rl   rm   s       r'   test_where_inplace_no_otherr  "  s    	C#sS3*5	6BcD%=#t}=>DXXdDX)F<<#266{C"&&#?@H"'r)   c                  D   \        . RORR7      p \        \        P                  \        P                  \        P                  .RR7      pV P	                  V ^8  V^ R7      p\        ^ \        \        P                  ^^.RR7      /4      p\
        P                  ! W#4       R# )r6   rg   rh   rU  r   Nr   )r   r	   r   rV  rG   rI   rK   )r>   ry   rl   rm   s       r'   test_where_other_nullable_dtyper  ,  su     
9G	,BBEE255"%%(8EXXb1fe!X,F!VRUUAqMABCH&+r)   c                     \        R . RO/RR7      p V P                  4       pV P                  V R8g  \        P                  4      pVP                  VR8g  \        P                  RR7       \
        P                  ! W!4       R# )r    stringrh   Tr   N)1r  3)r   r   rG   r   r   rI   rK   )r>   
df_inplacerl   s      r'   +test_where_inplace_string_array_consistencyr  6  sb    	C(	9BJXXbBh'FZ2%rvvt<&-r)   )r   r   r   r   )0r   
hypothesisr   numpyr   r\   pandas.core.dtypes.commonr   pandasr   r   r   r   r	   r
   r   r   r   pandas._testing_testingrI   pandas._testing._hypothesisr   fixturer(   r?   rA   r  r  r  r  r  r  r  r{  r}  r  r  slowr  r  r  r  r  r  r  r  r  r7   r)   r'   <module>r     s=       / 	 	 	  ; NO
 P
Ve- e-P)&"&2, 	,:, D%=1*0 2*0Z!$  ! ! !
,(*96, E4$q!0DE,,(,.r)   