+
    yȇi)?                        ^ RI t^ RIt^ RIHt ^ RIHtHtHtH	t	H
t
 ^ RIHt ^ RIHt ]P                   ! ]! ^^.^^.^^.^^..^^ .R7      ]! ^^.^^.^^.^^..^^.R7      ]! ^^.^^.^^.^^..RR.R7      ]! ^^.^^.^^.^^..R^ .R7      ]! ^^.^^.^^.^^..R^.R7      ]! ^^.^^.^^.^^..R^.R7      ]! R	R
.RR	.RR	.RR..^R.R7      ]! ^R
.^R	.^R	.^R..^ R.R7      ]! ^^.^^.^^.^R..RR.R7      .	R7      R 4       t]P                   R 4       t]P                   R 4       tR tR tR t]P.                  P1                  RRR.4      R 4       t]P.                  P1                  RRR.4      R 4       t]P.                  P1                  R]! ^4      4      R 4       tR tR tR t]P.                  P1                  R R! R" .4      R# 4       t ]P.                  P1                  R R$ R% .4      R& 4       t! ! R' R(4      t"R# ))    N)IS64)	DataFrameIndex
MultiIndexSeries
date_range)	safe_sortcolumnsC      ?g               @g      @g      @g       @X)paramsc                    V P                   # )zPairwise frames test_pairwise)param)requests   &q/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/window/test_pairwise.pypairwise_framesr      s     ==    c                 8    \        ^^.^^.^^.^^..^ ^.R7      # )z'Pairwise target frame for test_pairwiser
   r    r   r   pairwise_target_framer   #   s.     q!fq!fq!fq!f51vFFr   c                 8    \        . RO. RO. RO. RO.. ROR7      # )z&Pairwise other frame for test_pairwiser
   )N   r   )Nr      )N   r   )N   r   )YZr   r   r   r   r   pairwise_other_framer"   )   s      	|\<@ r   c           	      ^   T pV\         P                  P                  ^4      P                  \	        V4      4      ,           pVP                  ^2^R7      P                  V4      p\        P                  ! VP                  R,          \         P                  ! VRR VRR 4      R,          4       R# r   windowmin_periodsNi)r   r   )
nprandomdefault_rngstandard_normallenrollingcovtmassert_almost_equalilocseriesABresults   &   r   test_rolling_covr8   2   s    A	BII!!!$44SV<<AYYbbY155a8F6;;r?BFF1ST7AcdG,DT,JKr   c           	      ^   T pV\         P                  P                  ^4      P                  \	        V4      4      ,           pVP                  ^2^R7      P                  V4      p\        P                  ! VP                  R,          \         P                  ! VRR VRR 4      R,          4       R# r$   )r)   r*   r+   r,   r-   r.   corrr0   r1   r2   corrcoefr3   s   &   r   test_rolling_corrr<   :   s    A	BII!!!$44SV<<AYYbbY166q9F6;;r?BKK#$34,I$,OPr   c                     \        \        P                  ! ^\        P                  R7      \	        R^R7      R7      p V P                  4       p\        P                  V R&   \        P                  VR&   V P                  \        V 4      ^R7      P                  V4      p\        P                  ! VP                  R	,          V P                  V4      4       R# )
   dtypez
2020-01-01periodsindex:N   N:N
   Nr%   Nr(   )r   r)   arangefloat64r   copynanr.   r-   r:   r0   r1   r2   )abr7   s      r   !test_rolling_corr_bias_correctionrM   B   s    
		"BJJ'z,PR/S	A 	
AFFAbEVVAcFYYc!f!Y499!<F6;;r?AFF1I6r   funcr/   r:   c                 \   \        VP                  ^
^R7      V 4      ! 4       pVP                  \        R4      ^3^3,          pVP                  P                  ^4      Vn        \        V^,          P                  ^
^R7      V 4      ! V^,          4      p\        P                  ! W#RR7       R# )rF   r%   NFcheck_names)getattrr.   locslicerD   	droplevelr0   assert_series_equal)rN   framer7   expecteds   &&  r   test_rolling_pairwise_cov_corrrY   O   s    U]]"!]<dCEFZZta(!+,F<<))!,FLuQx''rq'A4HqRH6?r   methodc                 &  a a V^,          o\        SP                  ^
R7      S 4      ! V4      p\        VP                  ^
R7      S 4      ! S4      pVP                  V V3R l4      p\        P                  ! W$4       \        P                  ! W44       \        \        P                  P                  ^4      P                  VP                  4      VP                  VP                  R7      p\        VP                  ^
R7      S 4      ! V4      p\        \        VP                  4      4      Vn        \        V Uu/ uF1  qw\        W,          P                  ^
R7      S 4      ! WW,          4      bK3  	  up4      p\        P                  ! Wd4       R# u upi )r   r&   c                 H   < \        SP                  ^
R7      S4      ! V 4      # )rF   r\   )rR   r.   )xrZ   r4   s   &r   <lambda>(test_flex_binary_frame.<locals>.<lambda>^   s    b(A6 J1 Mr   rD   r   N)rR   r.   applyr0   assert_frame_equalr   r)   r*   r+   r,   shaperD   r   r   list)	rZ   rW   resres2expframe2res3kr4   s	   f&      @r   test_flex_binary_framerl   X   s.   1XF
&...+V
4U
;C5===+V4V<D
++M
NC##$$
		a 00=kkF 5===+V4V<Ddll+,DL
MRSUGEH$$B$/8C	CUSC $$ 	Ts   87Fr&   c                    \        \        P                  ! ^4      4      p\        \        P                  ! ^4      4      pVP	                  V R7      P                  VR7      P                  4       P                  4       '       g   Q hR# )r>   r\   )otherN)r   r)   zerosrG   r.   r:   isnaall)r&   srn   s   &  r   $test_rolling_corr_with_zero_variancers   q   s_     	rxx|A299R=!E99F9#((u(5::<@@BBBBr   c                     \        \        P                  ! R R.RR.RR.RR.RR	.R
R..4      4      p V ^ ,          P                  ^RR7      P	                  V ^,          4      p\
        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       g   Q h\        \        P                  P                  ^4      P                  R4      4      p V ^ ,          P                  ^RR7      P	                  V ^,          4      p\
        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       g   Q hR# )gF$?g)?gT5?g?'N?gFr1?g+	C-?gR	`?g1:b%?g9T!X4!?gXS_?gS= ?g\+Lt?T)centerc              3   |   "   T F2  p\         P                  ! \         P                  ! V4      4      ^8*  x  K4  	  R# 5ir   Nr)   abs
nan_to_num.0r^   s   & r   	<genexpr>#test_corr_sanity.<locals>.<genexpr>   '     :crvvbmmA&'1,c   :<Fc              3   |   "   T F2  p\         P                  ! \         P                  ! V4      4      ^8*  x  K4  	  R# 5irw   rx   r{   s   & r   r}   r~      r   r   N)   r   )r   r)   arrayr.   r:   rq   r*   r+   )dfrf   s     r   test_corr_sanityr   z   s   	
Z(Y'Z(Z(Z(Z(		

B Q%--$-
'
,
,RU
3C3:c:333:c:::::	299((+227;	<B
Q%--$-
'
,
,RU
3C3:c:333:c:::::r   c                     \        . RO\        ^4      R7      p \        ^^.\        ^ ^^4      R7      pV P                  ^^R7      P                  V4      p\        . RO4      p\        P
                  ! W#4       \        . RO\        ^4      R7      pV P                  ^^R7      P                  V4      p\        P
                  ! W#4       R# )r   rC   r%   Nr   r   r   )NNr   r   Nr   )r   ranger.   r/   r0   rV   s1s2r7   rX   s2as        r   test_rolling_cov_diff_lengthr      s    		q	*B	AeAq!n	-BZZqaZ044R8F'(H6,
U1X
.CZZqaZ044S9F6,r   c                     \        . RO\        ^4      R7      p \        ^^.\        ^ ^^4      R7      pV P                  ^^R7      P                  V4      p\        . RO4      p\        P
                  ! W#4       \        . RO\        ^4      R7      pV P                  ^^R7      P                  V4      p\        P
                  ! W#4       R# )r   rC   r%   Nr   )NNr   r   )r   r   r.   r:   r0   rV   r   s        r   test_rolling_corr_diff_lengthr      s    		q	*B	AeAq!n	-BZZqaZ055b9F'(H6,
U1X
.CZZqaZ055c:F6,r   fc                 J    V P                  ^
^R7      P                  V RR7      # rF   r%   Tpairwiser.   r/   r^   s   &r   r_   r_      !    199BA96::1t:Lr   c                 J    V P                  ^
^R7      P                  V RR7      # r   r.   r:   r   s   &r   r_   r_      !    199BA96;;A;Mr   c           	      J   \        ^^.^^.^^	.R^ ..\        RR.RR7      \        \        ^4      RR7      R7      p\        \        RR.RR7      \        P                  ! VP
                  VP                  .RR.R7      RR	7      pV ! V4      p\        P                  ! W24       R
# )r   r5   r6   foonamebarr   rD   namesrH   )r   rD   r@   Nr(   )	r   r   r   r   from_productrD   r   r0   rc   )r   r   df_expected	df_results   &   r   2test_rolling_functions_window_non_shrinkage_binaryr      s     

Q!Q!Q"a)sCju-E!H5)
B
 sCju-%%rxx&<UENSK
 "I)1r   c                 J    V P                  ^
^R7      P                  V RR7      # r   r   r   s   &r   r_   r_      r   r   c                 J    V P                  ^
^R7      P                  V RR7      # r   r   r   s   &r   r_   r_      r   r   c                    \        4       p\        \        R .RR7      \        . RR7      R7      pVR ,          P                  R4      VR &   \        \        P                  ! VP
                  VP                  .4      R7      p\        \        P                  ! VP
                  VP                  .RR.R7      \        R .RR7      RR7      pV ! V4      p\        P                  ! WS4       V ! V4      p\        P                  ! Wd4       R	# )
rK   r   r   r   r   rH   rC   r   )rD   r   r@   N)	r   r   astyper   r   rD   r   r0   rc   )r   df1df2df1_expecteddf2_expected
df1_result
df2_results   &      r   *test_moment_functions_zero_length_pairwiser      s     +C
E3%e4E"5<Q
RC3xy)CH:#:#:CIIs{{;S#TUL%%syy#++&>uenUse%(L 3J*33J*3r   c                     a  ] tR t^t o ]P
                  P                  RR R .4      R 4       t]P
                  P                  RR R R R R	 R
 .4      R 4       t]P
                  P                  RR R R R R R .4      R 4       t	]P
                  P                  RR R R ]P                  ! R ]P
                  P                  ]'       * RRR7      R7      R R .4      R 4       t]P
                  P                  R4      ]P
                  P                  RR R  R! R" R# R$ .4      R% 4       4       t]P
                  P                  RR& R' R( R) R* R+ .4      R, 4       tR- tR. tR/ tR0tV tR1# )2TestPairwiser   c                "    V P                  4       # N)r/   r   s   &r   r_   TestPairwise.<lambda>   s
    QUUWr   c                "    V P                  4       # r   )r:   r   s   &r   r_   r      s
    r   c                j   V! V4      p\         P                  ! VP                  VP                  4       \         P                  ! VP                  VP                  4       V! V4      pVP	                  4       P
                  pVP	                  4       P
                  p\         P                  ! WER R7       R# Fcheck_dtypeNr0   assert_index_equalrD   r   dropnavaluesassert_numpy_array_equalselfr   r   r   r7   rX   s   &&&&  r   test_no_flexTestPairwise.test_no_flex   s     ?#
fllO,C,CD
fnno.E.EF*+ ''??$++
##F%Hr   c                B    V P                  4       P                  R R7      # Tr   	expandingr/   r   s   &r   r_   r      s    akkm'''6r   c                B    V P                  4       P                  R R7      # r   r   r:   r   s   &r   r_   r      s    akkm(($(7r   c                F    V P                  ^R7      P                  RR7      # r   r\   Tr   r   r   s   &r   r_   r      s    aiiqi)--t-<r   c                F    V P                  ^R7      P                  RR7      # r   r   r   s   &r   r_   r      s    aiiqi)...=r   c                F    V P                  ^R7      P                  RR7      # r   comTr   ewmr/   r   s   &r   r_   r      s    aeeel&&&5r   c                F    V P                  ^R7      P                  RR7      # r   r   r:   r   s   &r   r_   r      s    aeeel'''6r   c                H   V! V4      p\         P                  ! VP                  P                  ^ ,          VP                  RR7       \         P                  ! \	        VP                  P                  ^,          4      \	        VP
                  P                  4       4      4       \         P                  ! VP
                  VP
                  4       V! V4      pVP                  4       P                  pVP                  4       P                  p\         P                  ! WERR7       R# r   FrP   r   N
r0   r   rD   levelsr	   r   uniquer   r   r   r   s   &&&&  r   test_pairwise_with_self$TestPairwise.test_pairwise_with_self   s     ?#
LL"O$9$9u	
 	fll))!,-o--4467	
 	fnno.E.EF*+ ''??$++
##F%Hr   c                B    V P                  4       P                  R R7      # Fr   r   r   s   &r   r_   r     s    akkm'''7r   c                B    V P                  4       P                  R R7      # r   r   r   s   &r   r_   r     s    akkm((%(8r   c                F    V P                  ^R7      P                  RR7      # r   r\   Fr   r   r   s   &r   r_   r     s    aiiqi)--u-=r   c                F    V P                  ^R7      P                  RR7      # r   r   r   s   &r   r_   r     s    aiiqi)...>r   c                F    V P                  ^R7      P                  RR7      # r   r   Fr   r   r   s   &r   r_   r     s    aeeel&&&6r   c                F    V P                  ^R7      P                  RR7      # r   r   r   s   &r   r_   r     s    aeeel'''7r   c                j   V! V4      p\         P                  ! VP                  VP                  4       \         P                  ! VP                  VP                  4       V! V4      pVP	                  4       P
                  pVP	                  4       P
                  p\         P                  ! WER R7       R# r   r   r   s   &&&&  r   test_no_pairwise_with_self'TestPairwise.test_no_pairwise_with_self  s     ?#
fllO,A,AB
fnno.E.EF*+ ''??$++
##F%Hr   c                D    V P                  4       P                  VR R7      # r   r   r^   ys   &&r   r_   r   (  s    **1t*<r   c                D    V P                  4       P                  VR R7      # r   r   r   s   &&r   r_   r   )  s    ++A+=r   c                H    V P                  ^R7      P                  VRR7      # r   r   r   s   &&r   r_   r   *  s    !,00T0Br   c                H    V P                  ^R7      P                  VRR7      # r   r   r   s   &&r   r_   r   -  s    QYYaY055a$5Gr   zPrecision issues on 32 bitF)reasonstrict)marksc                H    V P                  ^R7      P                  VRR7      # r   r   r   s   &&r   r_   r   2  s    1))!d);r   c                H    V P                  ^R7      P                  VRR7      # r   r   r   s   &&r   r_   r   3  s    1**1t*<r   c                   V! W4      p\         P                  ! VP                  P                  ^ ,          VP                  RR7       \         P                  ! \	        VP                  P                  ^,          4      \	        VP
                  P                  4       4      4       V! W#4      pVP                  4       P                  pVP                  4       P                  p\         P                  ! WVRR7       R# r   r   )r   r   r   r"   r   r7   rX   s   &&&&&  r   test_pairwise_with_other%TestPairwise.test_pairwise_with_other%  s    * ?9
LL"O$9$9u	
 	fll))!,-*2299;<	
 *A ''??$++
##F%Hr   zignore:RuntimeWarningc                D    V P                  4       P                  VR R7      # r   r   r   s   &&r   r_   r   N  s    **1u*=r   c                D    V P                  4       P                  VR R7      # r   r   r   s   &&r   r_   r   O  s    ++A+>r   c                H    V P                  ^R7      P                  VRR7      # r   r   r   s   &&r   r_   r   P  s    !,00U0Cr   c                H    V P                  ^R7      P                  VRR7      # r   r   r   s   &&r   r_   r   Q  s    !,11!e1Dr   c                H    V P                  ^R7      P                  VRR7      # r   r   r   s   &&r   r_   r   R  s    1))!e)<r   c                H    V P                  ^R7      P                  VRR7      # r   r   r   s   &&r   r_   r   S  s    1**1u*=r   c                   VP                   P                  '       d	   V! W4      MR pVe   VP                  P                  VP                  4      pVP                   P                  VP                   4      p\        P
                  ! VP                  V4       \        P
                  ! VP                   V4       R # \        P                  ! \        RR7      ;_uu_ 4        V! W4       R R R 4       \        P                  ! \        RR7      ;_uu_ 4        V! W!4       R R R 4       R #   + '       g   i     LG; i  + '       g   i     R # ; i)Nz'arg1' columns are not unique)matchz'arg2' columns are not unique)	r   	is_uniquerD   unionr0   r   pytestraises
ValueError)r   r   r"   r   r7   expected_indexexpected_columnss   &&&&   r   test_no_pairwise_with_other(TestPairwise.test_no_pairwise_with_otherJ  s      &&000 o4 	
 ,22889M9S9STN.66<<$,,  !!&,,?!!&..2BCz1PQQ/8 Rz1PQQ&8 RQ RQQQQs   	D%	D8%D5	8E		c                @    V P                  4       P                  V4      # r   r   r   s   &&r   r_   r   n  s    **1-r   c                @    V P                  4       P                  V4      # r   r   r   s   &&r   r_   r   o  s    ++A.r   c                D    V P                  ^R7      P                  V4      # r   r\   r   r   s   &&r   r_   r   p  s    !,003r   c                D    V P                  ^R7      P                  V4      # r  r   r   s   &&r   r_   r   q  s    !,11!4r   c                D    V P                  ^R7      P                  V4      # r   r   r   r   s   &&r   r_   r   r  s    1))!,r   c                D    V P                  ^R7      P                  V4      # r  r   r   s   &&r   r_   r   s  s    1**1-r   c                .   V! V\        . RO4      4      p\        P                  ! VP                  VP                  4       \        P                  ! VP                  VP                  4       V! V\        . RO4      4      pVP                  4       P                  pVP                  4       P                  p\        P                  ! WERR7       V! \        . RO4      V4      p\        P                  ! VP                  VP                  4       \        P                  ! VP                  VP                  4       V! \        . RO4      V4      pVP                  4       P                  pVP                  4       P                  p\        P                  ! WERR7       R# )r   Fr   N)r   r   r   r   )r   r0   r   rD   r   r   r   r   r   s   &&&&  r   test_pairwise_with_series&TestPairwise.test_pairwise_with_seriesk  s    ?F<$89
fllO,A,AB
fnno.E.EF*F<,@A ''??$++
##F%H6,'9
fllO,A,AB
fnno.E.EFVL)+@A ''??$++
##F%Hr   c                   \        \        ^4      \        R^R7      R7      pVP                  R4      P	                  V4      p\        \
        P                  .^,          \        R^R7      R7      p\        P                  ! W#4       R# )rE   2020rA   rC   12hN)	r   r   r   r.   r:   r)   rJ   r0   rV   )r   rr   r7   rX   s   &   r   test_corr_freq_memory_error(TestPairwise.test_corr_freq_memory_error  s]    58:fa#@A5!&&q)266(Q,j.KL
v0r   c           
        \         P                  ! \        R 4      \        R4      \        R4      .4      p\        ^4      p\	        \
        P                  ! ^4      P                  ^^4      W!R7      pVP                  RR7      P                  4       p\         P                  ! \        ^4      \        R 4      \        R4      \        R4      .4      p\         P                  ! \        R 4      \        R4      \        R4      .4      p\	        \
        P                  ! \
        P                  ! R	\
        P                  4      \
        P                  ! R	R4      \
        P                  ! R	R4      34      VVR7      p\        P                  ! WE4       R# )
abxyABra   g?)alphag      @@gK\ǸO@N)r   r   )r   r   re   r   r   r)   rG   reshaper   r/   vstackfullrJ   r0   rc   )r   r   rD   r   r7   rX   s   &     r   test_cov_mulittindex!TestPairwise.test_cov_mulittindex  s    ))4:tDz4:*NOaryy},,Q2%Qc"&&(''q4:tDz4PT:(VW))4:tDz4:*NOIIGGFBFF+GGFI.GGFI. 

 	f/r   c                   \         P                  ! R R.RR..RR.R7      p\        \        P                  ! R4      VR7      pVP                  ^4      P                  4       p\        \        P                  \         P                  ! \        P                  ! \        P                  ! ^\        P                  R7      ^4      R R.^,          RR.^,          .. ROR7      VR
7      p\        P                  ! W44       R	# )MNPQrK   rL   r   r
   r?   Nra   )rE   r   )NrK   rL   )r   from_arraysr   r)   onesr.   r:   rJ   repeatrG   int64r0   rc   )r   r   r   r7   rX   s   &    r   $test_multindex_columns_pairwise_func1TestPairwise.test_multindex_columns_pairwise_func  s    ((3*sCj)A#sTrwwv8A##%FF((IIbii:A>#JN#JN
 ' 
 	f/r   r   N)__name__
__module____qualname____firstlineno__r  markparametrizer   r   r   r   xfailr   r   filterwarningsr  r  r  r!  r,  __static_attributes____classdictcell__)__classdict__s   @r   r   r      s    [[S#46H"IJI KI [[67<=56	

I
I* [[78=>67	

I
I [[<=BLLGkk''H%A% (  <<	
"I#"I( [[ 78[[=>CD<=	

9
 99* [[-.34,-	

I
I,1020 0r   r   )#numpyr)   r  pandas.compatr   pandasr   r   r   r   r   pandas._testing_testingr0   pandas.core.algorithmsr	   fixturer   r   r"   r8   r<   rM   r2  r3  rY   rl   r   rs   r   r   r   r   r   r   r   r   r   <module>r@     s        , Aq6Aq6Aq6Aq62QFCAq6Aq6Aq6Aq62QFCAq6Aq6Aq6Aq62S#JGAq6Aq6Aq6Aq62S!HEAq6Aq6Aq6Aq62S!HEAq6Aq6Aq6Aq62S!HEC:SzC:SzBQPSHUAs8aX3x!S:QHMAq6Aq6Aq6As84sCjI

 G G
  LQ
7 %1@ 2@ FE?3% 4%0 58,C -C;.
-
- MN22  MN44&a0 a0r   