+
    xȇi"              	       ~   ^ RI t ^ RIt^ RIt^ RIt^ RIHtHtHtH	t	H
t
HtHtHtHtHtHtHtHtHt ^ RIHt ^ RIHt ^ RIHt R tR tR tR tR	 tR
 t R t!R t"R t#]PH                  PK                  R. R4O4      R 4       t&]PH                  PK                  R. R5O]'! ](! ^4      4      .4      R 4       t)]PH                  PK                  R. R5O. R5O3]'! ](! ^4      4      . R6O3.4      R 4       t*]PH                  PK                  RRR/R3/ R3RR/R3RR/R3.4      R 4       t+]PH                  PK                  R. R7O4      ]PH                  PK                  R^^.4      ]PH                  PK                  RRR.4      R 4       4       4       t,]PH                  PK                  R]! R ]
R!.4      ]! R"]
R#.4      .R$ R%7      R& 4       t-]PH                  PK                  R'^]P\                  ! ^ ^^4      .4      R( 4       t/]PH                  PK                  R)]! R*^R+7      ]! . R8O4      .]! R ^R+7      ]! . R9O4      ..4      R, 4       t0]PH                  PK                  R'^^.4      ]PH                  PK                  R-]]Pb                  3]Pd                  ]Pf                  3]']Ph                  3.4      R. 4       4       t5]PH                  PK                  R/. R:O4      R0 4       t6]PH                  PK                  R1. R;O4      ]PH                  PK                  R/. R<O4      ]PH                  PK                  R2. R=O4      R3 4       4       4       t7R# )>    N)CategoricalDatetimeIndexIntervalIntervalIndexNaTSeries	TimedeltaTimedeltaIndex	Timestampcut
date_rangeisnaqcuttimedelta_range)CategoricalDtype)Dayc                     \         P                  P                  ^4      P                  R4      p \	        V ^RR7      w  r\         P
                  ! V . R	O4      pVP                  P                  P                  p\         P                  ! WCRR
 RR7      '       g   Q hVP                  P                  P                  p\         P                  ! WCR,          RR7      '       g   Q h\        WRR7      p\        P                  ! W4       R# )     TretbinsNg{Gz?)atol   NN)include_lowestr   g      ?g      ?g      ?      ?)nprandomdefault_rngstandard_normalr   quantile
categoriesleftvaluesallcloserightr   tmassert_categorical_equal)arrlabels_ex_binsresult	ex_levelss         n/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/reshape/test_qcut.py	test_qcutr2      s    
))


"
2
24
8C S!T*IFkk#89G##**F;;vs|$7777$$++F;;vr{6666C6I2    c                      \         P                  P                  ^4      P                  R4      p \	        V ^
RR7      p\        \         P                  ! V4      4      ^
8X  g   Q hR# )r   r   Fr,   N)r   r    r!   r"   r   lenunique)r+   factors     r1   test_qcut_boundsr9   /   sK    
))


"
2
24
8C#r%(Fryy !R'''r3   c                      \         P                  P                  ^4      P                  ^d4      p \	        V . RO4      p\	        V ^4      p\
        P                  ! W4       R# )r   Nr   )r   r    r!   r"   r   r)   r*   )r+   r8   expecteds      r1   test_qcut_specify_quantilesr<   6   sG    
))


"
2
23
7C#01FC|H1r3   c                      \         P                  ! \        R R7      ;_uu_ 4        \        . RO^4       RRR4       R#   + '       g   i     R# ; i)zedges.*uniquematchN)
r   r   r   r   r   r   r   r   r   r   )pytestraises
ValueErrorr    r3   r1   test_qcut_all_bins_samerD   >   s-    	z	9	9+Q/ 
:	9	9	9s	   >A	c            	          \         P                  ! ^
4      p \        V ^4      p\        \	        RR4      \	        RR4      \	        RR4      \	        R^	4      .4      p\
        P                  ! VP                  V4       R# )
   g      @g      @g      @NMbP)r   aranger   r   r   r)   assert_index_equalr$   )r&   iir0   s      r1   test_qcut_include_lowestrK   C   sg    YYr]F	faBVT"T3S$T1		
I "--3r3   c                      \         P                  P                  ^4      P                  ^d4      p \         P                  V R&   \        V ^4      p\        VR,          4      P                  4       '       g   Q hR# )r   :N   NN)r   r    r!   r"   nanr   r   all)r+   r/   s     r1   test_qcut_nasrP   R   sW    
))


"
2
23
7CvvCH#q\Fs  """"r3   c                      \        ^ ^.^4      p \        R^4      \        ^^4      .p\        VRR7      p\        P                  ! W4       R# )r   TorderedNrG   )r   r   r   r)   r*   )r/   	intervalsr;   s      r1   test_qcut_indexrU   Z   sB    1a&!_F&!$hq!n5I9d3H1r3   c                 n   V ! \         P                  P                  R RR4      4      p\        P                  ! V4      p\        V^4      pVP                  P                  pVP                  P                  pWE8  P                  4       '       g   Q hVR,          VRR 8*  P                  4       '       g   Q hR# )reshapedatazcut_data.csvr   Nr   )
ospathjoinr   loadtxtr   r$   r%   r(   rO   )datapathcut_filer+   r/   startsendss   &     r1   test_qcut_binning_issuesra   b   s    YGHH
**X
C#r]F##F""DM    2J$s)#((****r3   c                  @   \        . RO4      p \        V . RO4      p\        P                  ! \	        RR4      \	        RR4      \	        R^4      .4      p\        VP                  . R	O4      4      P                  \        RR7      4      p\        P                  ! W4       R# )
r   gZd;O@gZd;O@TrR   N)	r   r   r                     )r   gZd;O?gZd;O?r   rG   )	r   r   r   r   r   r   r   r   r   )
r   r   r   arrayr   takeastyper   r)   assert_series_equal)serres
exp_levelsexps       r1   test_qcut_return_intervalsrq   n   s    
,
-C
s(
)C	&%	 (5%"8(5!:LMJ !<=
>
E
E&C 3$r3   r,   fooc                     \        ^4      pRp\        P                  ! \        VR7      ;_uu_ 4        \	        V^V R7       RRR4       R#   + '       g   i     R# ; i)re   zJBin labels must either be False, None or passed in as a list-like argumentr>   r5   Nranger@   rA   rB   r   r,   r&   msgs   &  r1   test_qcut_incorrect_labelsrx   {   s>     1XF
VC	z	-	-VQv& 
.	-	-	-   AA	c                     \        ^
4      pRp\        P                  ! \        VR7      ;_uu_ 4        \	        V^V R7       RRR4       R#   + '       g   i     R# ; i)rF   z9Bin labels must be one fewer than the number of bin edgesr>   r5   Nrt   rv   s   &  r1   test_qcut_wrong_length_labelsr{      s>     2YF
EC	z	-	-VQv& 
.	-	-	-ry   zlabels, expectedc                 ~    \        ^4      p\        V^V R7      p\        VRR7      p\        P                  ! W14       R# )rc   r5   TrR   N)ru   r   r   r)   r*   )r,   r;   r&   r/   s   &&  r1   test_qcut_list_like_labelsr}      s5     1XF&!F+F8T2H1r3   z
kwargs,msg
duplicatesdropzBin edges must be uniqueraisez(invalid value for 'duplicates' parameterc                 T   . ROpVe=   \         P                  ! \        VR7      ;_uu_ 4        \        V^3/ V B  RRR4       R# \        V^3/ V B p\	        \        R^4      \        ^^4      .4      p\        P                  ! VP                  V4       R#   + '       g   i     R# ; i)r   Nr>   )r   r   r   r   r   r   rc   rG   )	r@   rA   rB   r   r   r   r)   rI   r$   )kwargsrw   r&   r/   r;   s   &&   r1   test_qcut_duplicates_binr      s     #F
]]:S11%f% 21 fa*6* (61"5x1~!FG
f//: 211s   BB'	zdata,start,endlengthFc                 H   \        V .V,          4      p\        V^VR7      pVfD   \        \        W4      .V,          RR7      p\        V4      P	                  \        RR7      4      pM#\        ^ .V,          \        P                  R7      p\        P                  ! Wh4       R# )r   r5   Nr(   )closedTrR   dtype)
r   r   r   r   rk   r   r   intpr)   rl   )	rX   startendr   r,   rm   r/   rT   r;   s	   &&&&&    r1   test_single_quantiler      s     $&
!C#q(F~!8E#7"86"A'R	)$++,<T,JK1#,bgg66,r3   rm   2018010120180103z0 days2 daysc                 ,    \        V P                  4      # )N)strr   )xs   &r1   <lambda>r      s    #agg,r3   )idsc                 H   \        V 4      p V P                  P                  V4      p \        ^VR7      P                  V4      p\        V ^ ,          V,
          \        P
                  V ^,          \        4       ,
          .V P                  R7      p\        V ^,          \        4       ,
          \        P
                  V ^,          .V P                  R7      p\        P                  ! W44      p\        \        VRR7      4      p\        V ^4      p\        P                  ! Wv4       R# )r   )unitr   TrR   N)r   dtas_unitr	   r   rN   r   r   r   from_arraysr   r   r)   rl   )rm   r   tdr%   r(   rT   r;   r/   s   &&      r1   test_qcut_natr      s     +C
&&..
C	14	 	(	(	.B3q6B;A7syyIDCFSUNBFFCF3399EE))$6Ik)T:;H#q\F6,r3   binsc                    R p\        \        R^VRR7      4      p\        W 4      p\        \        \	        \        RVR7      \        RVR7      4      \	        \        RVR7      \        RVR7      4      \	        \        RVR7      \        RVR7      4      .4      4      P                  \        R	R
7      4      p\        P                  ! W44       R# )z
US/Eastern20130101ns)periodstzr   z2012-12-31 23:59:59.999999999)r   z2013-01-01 16:00:00z2013-01-02 08:00:00z2013-01-03 00:00:00TrR   N)
r   r   r   r   r   r   rk   r   r)   rl   )r   r   rm   r/   r;   s   &    r1   test_datetime_tz_qcutr      s     
B
JbtD
EC#_F="E3; 3;3; 3;3;	
" fd+,# $ 6,r3   zarg,expected_bins1day)r   c                     V P                  V4      p VP                  V4      p\        V 4      p\        V^RR7      w  rE\        P                  ! WQ4       R# )r   Tr   N)r   r   r   r)   rI   )argexpected_binsr   rm   r/   result_binss   &&&   r1   test_date_like_qcut_binsr      sJ     ++d
C!))$/M
+CsAt4F+5r3   zbox, comparec                     V! . RO^
,          4      pV! . RO^
,          4      p\        W0RR7      p\        W@RR7      pV! We4       R# )r   r   )r~   N)r   r   r   r   r   )FTTFT)r   )r   boxcomparedata_expecteddata_resultr;   r/   s   &&&    r1   test_qcut_bool_coercion_to_intr     sC     ",-M6;<KMF;H+7FFr3   qc                    \         P                  ! \        P                  ! ^d4      VR7      p\         P                  VR&   \        W 4      p\        VP                  \        4      V 4      p\        P                  ! W44       R# )d   r   :NNr   N)
pdri   r   rH   NAr   rk   floatr)   r*   )r   any_numeric_ea_dtyper+   r/   r;   s   &&   r1   test_qcut_nullable_integerr      sT    
((299S>)=
>CuuCH#\FCJJu%q)H1r3   scale	precisionc                     V \         P                  ! V^,           4      ,          P                  V4      p\        W1VR7      p\	        W44       F  w  rVWV9   d   K  Q h	  R# )r   )r   N)r   rH   roundr   zip)r   r   r   r+   r/   valuebuckets   &&&    r1   test_qcut_containsr   +  sM    
 299QU##
*
*9
5C#I.FS) *r3   )rr   r   T)abc)r   r   r   ))      "@gsh|!@r   )        rG   r   )      "gn "r   )z1 daysr   z3 days)z
2018-01-01z
2018-01-02z
2018-01-03)r   re   rF   )r   gUUUUUU?g      1@)rc   rg   	   )r   rc      )8rY   numpyr   r@   pandasr   r   r   r   r   r   r   r	   r
   r   r   r   r   r   r   pandas._testing_testingr)   pandas.api.typesr   pandas.tseries.offsetsr   r2   r9   r<   rD   rK   rP   rU   ra   rq   markparametrizerx   listru   r{   r}   r   r   r   linspacer   r   rl   ri   r*   assert_equalr   r   r   rC   r3   r1   <module>r      s   	         - &3$(20
4#2	+
% #34' 5' OT%(^#DE' F' 	/*	eAh#22 
	&	'(
	 "<=
	 JK	
;
; S Aq6*D%=1- 2 +
- 	z3
34#x01 	  -- !R[[Aq%9!:;- <-6  FA.9:	

 z1-DE	
	66 !Q(	''(	2../	r ) j)2 *2 "45i(j1 2 ) 6r3   