+
    yȇiB4                         ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHtH	t	H
t
HtHtHtHt ^ RIHt ^ RIHt  ! R R4      tR# )    N)PYPY)CategoricalCategoricalDtype	DataFrameIndexNaTSeries
date_range)	is_scalarc                   (  a  ] tR t^t o ]P
                  P                  RRR.4      R 4       tR tR t	]P
                  P                  R]
! R4      ]P                  3. R0O]P                  3]P                  ! ]! ]! R	^R
7      RR7      ]]P
                  P#                  RR7      R7      .4      ]P
                  P                  RRR.4      R 4       4       t]P
                  P                  RRRR]P                  .]
! R4      3^^^]P                  .. R1O3.4      ]P
                  P                  RRR.4      R 4       4       t]P
                  P                  RRR.4      R 4       t]P
                  P                  RRR.4      R 4       t]P
                  P                  RRR.4      R 4       t]P
                  P                  R. R2O4      ]P
                  P                  RRR.4      R 4       4       t]P
                  P                  RR3R4.4      R 4       t]P
                  P                  R . R5O. R6O^.3. R7O. R6O^^.3. R8O. R6O. R6O3]P                  ]P                  ]P                  ^^.. R6O^^.3]P                  ]P                  ]P                  ^^^.. R6O^.3]P                  ]P                  ^^^.. R6O^.3.4      R! 4       tR" tR# tR$ tR% tR& tR' tR( t ]P
                  P                  R)^R*. R0OR+.4      R, 4       t!R- t"R.t#V t$R/# )9TestCategoricalAnalyticsaggregationminmaxc                   \        . RORR7      pRV 2p\        W!4      p\        P                  ! \        VR7      ;_uu_ 4        V! 4        RRR4       VR8X  d   \
        P                  M\
        P                  p\        P                  ! \        VR7      ;_uu_ 4        VP                  V4       RRR4       R#   + '       g   i     Lw; i  + '       g   i     R# ; i)aFordered)Categorical is not ordered for operation matchNr   r   bcd)	r   getattrpytestraises	TypeErrornpminimummaximumreduce)selfr   catmsgagg_funcufuncs   &&    ~/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/arrays/categorical/test_analytics.pytest_min_max_not_ordered_raises8TestCategoricalAnalytics.test_min_max_not_ordered_raises   s     .>9+G3,]]9C00J 1 *U2



]]9C00LL 10	 10 100s   B;C;C	C	c                `   \        . RORR7      pV! V4      pVP                  4       pVP                  4       pVR 8X  g   Q hVR8X  g   Q h\        P                  P                  V4      R 8X  g   Q h\        P                  P                  V4      R8X  g   Q h\        . RO. RORR7      pV! V4      pVP                  4       pVP                  4       pVR8X  g   Q hVR 8X  g   Q h\        P                  P                  V4      R8X  g   Q h\        P                  P                  V4      R 8X  g   Q hR# )r   r   Tr   
categoriesr   Nr   )r   r   r   r   )r   r   r   r    r!   r#   r"   )r$   index_or_series_or_arrayr%   obj_min_maxs   &&    r)   test_min_max_ordered-TestCategoricalAnalytics.test_min_max_ordered%   s	   .=&s+wwywwys{{s{{zz  %,,,zz  %,,,  -A4
 's+wwywwys{{s{{zz  %,,,zz  %,,,    c                Z   \        . RORR7      p\        V4      pVP                  R4      p\        \        R.VP                  R7      4      p\
        P                  ! W44       VP                  R4      p\        \        R .VP                  R7      4      p\
        P                  ! WV4       R# )	r   r   Tr   r   dtyper   Nr   )r   r   aggr	   r8   tmassert_series_equal)r$   r%   df
result_maxexpected_max
result_minexpected_mins   &      r)   test_min_max_reduce,TestCategoricalAnalytics.test_min_max_reduce<   s|    .=s^VVE]
k3%syyAB
z8VVE]
k3%syyAB
z8r5   zcategories,expectedABCz
2020-01-01)periodscategoryr7   z1https://github.com/pandas-dev/pandas/issues/29962)reason)marksc                T    \        . VR R7      p\        WC4      pV! 4       pWbJ g   Q hR# Tr-   N)r   r   )r$   r.   expectedr   r%   r'   results   &&&&   r)   test_min_max_ordered_empty3TestCategoricalAnalytics.test_min_max_ordered_emptyI   s/    " "TB3,!!!r5   zvalues, categoriesr   r   r   cbafunctionc                    \        WR R7      p\        WS4      ! VR7      pVRJ d   V\        P                  J g   Q hR# VR8X  d
   V^ ,          MV^,          pWg8X  g   Q hR# )Tr-   skipnaFr   N)r   r   r    nan)r$   valuesr.   rO   rR   r%   rK   rJ   s   &&&&&   r)   test_min_max_with_nan.TestCategoricalAnalytics.test_min_max_with_nan`   sZ     &F'v6U?RVV###(0E(9z!}z!}H%%%r5   c                    \        \        P                  .^^.RR7      p\        W14      ! VR7      pV\        P                  J g   Q hR# )   Tr-   rQ   N)r   r    rS   r   )r$   rO   rR   r%   rK   s   &&&  r)   test_min_max_only_nan.TestCategoricalAnalytics.test_min_max_only_nanp   s=     266(1vtD'v6r5   methodc                   \        \        P                  ^^\        P                  .. RORR7      p\        P                  ! \
        RR7      ;_uu_ 4        \        W!4      ! RR7       RRR4       R#   + '       g   i     R# ; i)rX   Tr-   z.* got an unexpected keywordr   )numeric_onlyN            rX   )r   r    rS   r   r   r   r   )r$   r[   r%   s   && r)    test_numeric_only_min_max_raises9TestCategoricalAnalytics.test_numeric_only_min_max_raisesw   sW     VVQ266"
 ]]9,JKKC d3 LKKKs   A22B	c                
   \        . RORR7      pRV R2p\        \        V4      p\        P                  ! \
        \        P                  ! V4      R7      ;_uu_ 4        V! V4       RRR4       R#   + '       g   i     R# ; i)r   Fr   r   zF
you can use .as_ordered() to change the Categorical to an ordered oner   Nr   r   r   r   )r   r   r    r   r   r   reescape)r$   r[   r%   r&   s   &&  r)   test_numpy_min_max_raises2TestCategoricalAnalytics.test_numpy_min_max_raises   se    .>7x @T T 	 V$]]9BIIcN;;3K <;;;s   	A11B	kwargc                   \        . R	ORR7      pRV RV 2pVR8X  d   RpV^*/p\        \        V4      p\        P                  ! \
        VR7      ;_uu_ 4        V! V3/ VB  RRR4       R#   + '       g   i     R# ; i)
r   Tr   zthe 'z=' parameter is not supported in the pandas implementation of axisz8`axis` must be fewer than the number of dimensions \(1\)r   Nrf   )r   r   r    r   r   
ValueError)r$   r[   rk   r%   r&   kwargss   &&&   r)   ,test_numpy_min_max_unsupported_kwargs_raisesETestCategoricalAnalytics.test_numpy_min_max_unsupported_kwargs_raises   s|     .=E7  	 F?MCV$]]:S113!&! 2111s   
A--A>	zmethod, expectedc                h    \        . RORR7      p\        \        V4      pV! VRR7      pWB8X  g   Q hR# )r   Tr   N)rm   rf   )r   r   r    )r$   r[   rJ   r%   rK   s   &&&  r)   #test_numpy_min_max_axis_equals_none<TestCategoricalAnalytics.test_numpy_min_max_axis_equals_none   s3    .=V$$'!!!r5   zvalues,categories,exp_modec                    \        WR R7      p\        V4      P                  4       P                  p\        W2R R7      p\        P
                  ! WV4       R# rI   )r   r	   mode_valuesr:   assert_categorical_equal)r$   rT   r.   exp_moder%   resexps   &&&&   r)   	test_mode"TestCategoricalAnalytics.test_mode   sB     &FSk (((4H
##C-r5   c                t   \        . RO. ROVR7      p\        V4      pVP                  R4      pV^8X  g   Q h\        V4      '       g   Q hVP                  R4      pV^8X  g   Q h\        V4      '       g   Q hVP                  R.4      pVP                  R.4      p\        P
                  ! ^.\        P                  R7      p\        P                  ! WF4       \        P                  ! WV4       VP                  RR.RR7      pVP                  RR.RR7      p\        P
                  ! ^^.\        P                  R7      p\        P                  ! WF4       \        P                  ! WV4       \        P                  ! \        RR7      ;_uu_ 4        VP                  R4       R	R	R	4       \        P                  ! \        RR7      ;_uu_ 4        VP                  R4       R	R	R	4       R
p\        P                  ! \        VR7      ;_uu_ 4        VP                  RR.4       R	R	R	4       \        P                  ! \        VR7      ;_uu_ 4        VP                  RR.4       R	R	R	4       R	#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lx; i  + '       g   i     R	# ; i)cheeseapplebreadr-   r7   right)sidecucumberr   NzMCannot setitem on a Categorical with a new category, set the categories first)r   milkr   r   r   )r   r   r   r   )r   r	   searchsortedr   r    arrayintpr:   assert_numpy_array_equalr   r   r   )r$   r   r%   serres_catres_serr{   r&   s   &&      r)   test_searchsorted*TestCategoricalAnalytics.test_searchsorted   s    9;

 Sk ""7+!||!!!!""7+!||!!!! ""G9-""G9-hhs"''*
##G1
##G1 ""GW#5G"D""GW#5G"Dhh1vRWW-
##G1
##G1 ]]9J77Z( 8]]9J77Z( 8
' 	 ]]9C00gz23 1]]9C00gz23 10 8777 10000s0   I-J JJ&-I=	 J	J#	&J7	c                   \        . ROVR7      p\        . ROVR7      pVP                  4       p\        P                  ! WC4       \        . ROVR7      pVP                  4       p\        P                  ! V\        R R.VR7      4       \        . ROVR7      pVP                  4       p\        . ROVR7      p\        P                  ! WE4       \        R\
        P                  R\
        P                  R .VR7      pVP                  4       p\        R\
        P                  R .VR7      p\        P                  ! WE4       R# )	r   r   r   r7   N)r   r   r   )r   r   r   r   )r   r   r   r   r   )r   r   r   )r   r   uniquer:   rx   r    rS   )r$   r   r8   r%   rz   exp_cats   &&    r)   test_unique$TestCategoricalAnalytics.test_unique   s     'B /7jjl
##C-.e<jjl
##Cc3Zu)MN35AjjloU;
##C1 3RVVS9GjjlsBFFC0>
##C1r5   c                   \        . ROVR7      p\        . ROVR7      p\        . ROVR7      p\        P                  ! VP	                  4       V4       \        P
                  ! \        V4      P	                  4       \        V4      4       \        P                  ! \        V4      P	                  4       V4       \        . ROVR7      p\        ^^.VR7      p\        P                  ! VP	                  4       V4       \        P
                  ! \        V4      P	                  4       \        V4      4       \        P                  ! \        V4      P	                  4       V4       R# )ra   r   r7   Nra   rb   rX   )ra   rX   rb   rb   rX   )ra   rX   rb   )rX   rX   rb   rb   )r   r   r:   rx   r   assert_index_equalr   r	   )r$   r   r8   r   r{   s   &&   r)   test_unique_index_series1TestCategoricalAnalytics.test_unique_index_series   s     G<u5 )51
##AHHJ4
eAhoo/s<
##F1I$4$4$6<E21a&.
##AHHJ4
eAhoo/s<
##F1I$4$4$6<r5   c                &   \        . RO4      pVP                  ^4      p\        \        P                  R RRR.4      p\        P
                  ! W#4       \        P
                  ! VRR	 VR,          4       VP                  R
4      p\        RRR \        P                  \        P                  .. ROR7      p\        P
                  ! WE4       \        P
                  ! VR,          VRR
 4       \        P
                  ! WP                  ^ 4      4       R# )r   r   r   r   N:rX   NN)r.   :rb   NN)r   r   r   r   r   r   )r   shiftr    rS   r:   rx   )r$   r%   sp1xp1sn2xp2s   &     r)   
test_shift#TestCategoricalAnalytics.test_shift  s    34 iil2663S#67
##C-
##CHc"g6 iim#sBFFBFF+8L
 	##C-
##CGS"X6 	##C16r5   c                J    \        . RO4      p^pVP                  V8X  g   Q hR# )rX   NrX   rb   ra   )r   nbytes)r$   r%   r{   s   &  r)   test_nbytes$TestCategoricalAnalytics.test_nbytes$  s#    )$zzS   r5   c                   \        . RO4      p^ VP                  u;8  d   VP                  4       8:  g   Q h Q h^ VP                  u;8  d   VP                  RR7      8:  g   Q h Q h\        . RO4      pV'       dn   VP                  P                  P
                  R8X  d%   VP                  RR7      VP                  8  g   Q hMGVP                  RR7      VP                  8  g   Q hM#VP                  RR7      VP                  8  g   Q h\        '       gB   VP                  RR7      \        P                  ! V4      ,
          p\        V4      ^d8  g   Q hR# R# )rX   T)deeppythonNr   )foor   bar)
r   r   memory_usager.   r8   storager   sys	getsizeofabs)r$   using_infer_stringr%   diffs   &&  r)   test_memory_usage*TestCategoricalAnalytics.test_memory_usage)  s"   )$ 3::3!1!1!3333333::<!1!1t!1!<<<<<</0~~##++x7''T'2SZZ???''T'2cjj@@@###.;;;t ###.s1CCDt9s?"?	 r5   c           
     n   \        \        R 4      \        R4      RR7      pVP                  R RR7      p\        \        R4      \        R4      RR7      p\        P                  ! W#4       \        \        R 4      \        R	4      R
R7      pVP                  R RR7      p\        \        R4      \        R4      R
R7      p\        P                  ! W#4       VP                  R RR7      p\        P
                  ! V\        \        P                  ! ^.^,          \        P                  R7      4      4       R# )ABABCCBATr-   c                 "    V P                  4       # Nlowerxs   &r)   <lambda>3TestCategoricalAnalytics.test_map.<locals>.<lambda>A  
    r5   N)	na_actionababcrN   rC   Fc                 "    V P                  4       # r   r   r   s   &r)   r   r   F  r   r5   abcc                     ^# )rX    r   s   &r)   r   r   J  s    r5   r7   )
r   listmapr:   rx   r   r   r    r   int64)r$   r   rK   r{   s   &   r)   test_map!TestCategoricalAnalytics.test_map?  s    W$u+tL*d;$w-DKN
##F0W$u+uM*d;$w-DKO
##F0{d3
feBHHaS1WBHH,M&NOr5   valueTrueg      @c                    \        . RO4      pR\        V4      P                   2p\        P                  ! \
        VR7      ;_uu_ 4        VP                  VR7       RRR4       R#   + '       g   i     R# ; i)Az9For argument "inplace" expected type bool, received type r   )inplaceN)r   Br   Cr   )r   type__name__r   r   rn   sort_values)r$   r   r%   r&   s   &&  r)   test_validate_inplace_raises5TestCategoricalAnalytics.test_validate_inplace_raisesN  s\    34!%[1124 	
 ]]:S11OOEO* 2111s   
A''A8	c                   \        R R.4      p\        RR.4      pVR,          P                  VRR7      pVP                  P                  \
        P                  8X  g   Q hVP                  R
R
.RR7      p\        P                  ! W44       R	# )r   r   g        g      ?:Nr   Nlinear)interpolationT)
allow_fillNr   )
r   r   	_quantile_codesr8   r    int8taker:   assert_extension_array_equal)r$   r%   idxrK   rJ   s   &    r)   test_quantile_empty,TestCategoricalAnalytics.test_quantile_emptyY  sw    3*%S#JR""3h"?}}""bgg---88RH86
''9r5   r   Nr   r   )rm   outkeepdims)r   r   )r   r   )rX   rX   rb   r`   r_   r_   r_   r^   )rX   rX   rX   r`   r_   r_   r_   )rX   rb   ra   r`   r_   )%r   
__module____qualname____firstlineno__r   markparametrizer*   r3   rA   r   r    rS   paramr	   r
   r   xfailrL   rU   rY   rc   ri   rp   rs   r|   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell__)__classdict__s   @r)   r   r      sL    [[]UEN; <-.9 [[%["&&!LLz,:*Mkk''N ( 
	
 [[]UEN;" <" [[S"&&
!4;	/1aBFF2CY1OP [[Z%8	& 9	
	& [[Z%8  9  [[Xu~64 74 [[Xu~6 7 [[W&AB[[Xu~6" 7 C" [[/,1MN" O" [[$"OaS9"OaV<o?ffbffbffa+_q!fEffbffbffaA.!EffbffaA&!=	

.
.04d20=&7*!
#,P [[Wq&)S&AB+ C+: :r5   r   )rg   r   numpyr    r   pandas.compatr   pandasr   r   r   r   r   r	   r
   pandas._testing_testingr:   pandas.api.typesr   r   r   r5   r)   <module>r      s7    	 
       &K: K:r5   