+
    yȇi2                     f   ^ 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 ^ RIHt ^ RIHu Ht  ! R R4      t ! R R4      t ! R R4      t]P4                  P7                  R	R
R.4      R 4       t]P4                  P7                  R	R
R.4      R 4       t]P<                  R 4       tR t R# )    N)NACategoricalCategoricalIndexIndexIntervalIntervalIndexNaTPeriodIndexSeries	Timedelta	Timestampc                     a  ] tR t^t o R tR t]P                  P                  RRRR..4      R 4       t	]P                  P                  R]
! RR.. ROR	7      ]
! RR.. ROR	7      ]
! RR.R.R	7      ]
! RR.R.R	7      .4      R
 4       t]P                  P                  R]
! RR.4      ]
! RR.RR.RR7      ]
! RR.. RORR7      .4      R 4       tR tR tRtV tR# )!TestCategoricalIndexingWithFactorc                   \        . RORR7      pV^ ,          R 8X  g   Q hVR,          R8X  g   Q hV. RO,          p\        P                  ! VP                  \        P
                  ! . R	O\        P                  R7      4       V\        P                  ! V4      R8H  ,          p\        P                  ! VP                  \        P
                  ! . R
O\        P                  R7      4       R# )acTordereddtypeNr   br   r   r   r   r   r   )r         )r   r   r   )r   r   r   )r   tmassert_numpy_array_equal_codesnparrayint8asarray)selffactorsubfs   &  }/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/arrays/categorical/test_indexing.pytest_getitem.TestCategoricalIndexingWithFactor.test_getitem   s    EtTayCbzS   i 
##DKK)2771STbjj(C/0
##DKK)2771ST    c                `   \        . RORR7      pVP                  4       pRV^ &   V^ ,          R8X  g   Q hR VR	&   VR	,          R 8X  g   Q hVP                  4       p\        P                  ! \	        V4      RR7      pRV^ &   RVR	&   RW#&   \        . R
ORR7      p\
        P                  ! W$4       R# )r   r   r   Tr   boolr   Nr   r   )r   r   r   r   r   r   r   r   )r   copyr   zeroslenr   assert_categorical_equal)r#   r$   r   indexerexpecteds   &    r&   test_setitem.TestCategoricalIndexingWithFactor.test_setitem#   s    EtTKKM!ts{{"u|| KKM((3q60

GQUV
##A0r)   
categoriesNr   r   c                    \        R R.VR7      p\        RR .RR .R7      p\        P                  ! RR.4      pW$,          W4&   \        R R .RR .R7      p\        P                  ! W54       R# )r   r   r4   TFN)r   r   r    r   r/   )r#   r4   othertargetmaskr1   s   &&    r&   test_setitem_same_but_unorderedATestCategoricalIndexingWithFactor.test_setitem_same_but_unordered6   se     S#J:>c3ZS#J?xxu&{SzsCjA
##F5r)   r7   r6   c                    \        R R.R R.R7      p\        P                  ! RR.4      pRp\        P                  ! \
        VR7      ;_uu_ 4        W,          W#&   RRR4       R#   + '       g   i     R# ; i)r   r   r6   TFCCannot set a Categorical with another, without identical categoriesmatchNr   r   r    pytestraises	TypeErrorr#   r7   r8   r9   msgs   &&   r&   'test_setitem_different_unordered_raisesITestCategoricalIndexingWithFactor.test_setitem_different_unordered_raises@   sX     c3ZS#J?xxu&S]]9C00 ;FL 1000s   A%%A6	Tr4   r   c                    \        R R.R R.RR7      p\        P                  ! RR.4      pRp\        P                  ! \
        VR7      ;_uu_ 4        W,          W#&   RRR4       R#   + '       g   i     R# ; i)r   r   TrH   Fr=   r>   Nr@   rD   s   &&   r&    test_setitem_same_ordered_raisesBTestCategoricalIndexingWithFactor.test_setitem_same_ordered_raisesQ   sZ     c3ZS#JMxxu&S]]9C00 ;FL 1000s   A&&A7	c                X    \        . RO4      pV^ ,          V^&   V^,          R8X  g   Q hR# )r   Nr   r   )rM   )r   r   rM   )r   r#   cats   & r&   test_setitem_tuple4TestCategoricalIndexingWithFactor.test_setitem_tuplea   s.    23 QA1vr)   c                *   \        \        P                  P                  ^4      P	                  ^ ^RR7      P                  \        P                  4      4      P                  R.4      p\        P                  ! R.4      P                  \        P                  4      pRW&   VP                  \        P                  ! R.4      P                  \        P                  4      ,          p\        P                  ! V\        P                  ! ^.RR7      4       R# )r   I size順 r!   r   Ni)r   r   randomdefault_rngintegersastyper!   add_categoriesr    int64codesr   r   )r#   rO   r0   results   &   r&   test_setitem_listlike7TestCategoricalIndexingWithFactor.test_setitem_listlikei   s     II!!!$--a-@GGP

.%
! 	 ((F8$++BHH5 288VH-44RXX>?
##FBHHaS,GHr)    )r   r   r   r   r   r   )__name__
__module____qualname____firstlineno__r'   r2   rA   markparametrizer:   r   rF   rJ   rP   r_   __static_attributes____classdictcell____classdict__s   @r&   r   r      s    	U1& [[\D3*+=>6 ?6 [[c
?c
?c
u5c
u5		
'' [[c
#c
Sz4Hc
M	
'' I Ir)   r   c                   X  a  ] tR t^yt o R tR tR t]P                  P                  RR]
P                  ]]]P                  RRRR	R
R.4      R 4       t]P                  P                  R. RO^^..4      R 4       t]P                  P                  R. RO. RO. RO. RO.4      ]P                  P                  R^^.^^.^^.^^..4      ]P                  P                  R]].4      ]P                  P                  R. RO4      R 4       4       4       4       tR tR tR tR tR tRtV tR# )TestCategoricalIndexingc                    \        . RO4      pV^,          pVR8X  g   Q hVR,          p\        RR .. ROR7      p\        P                  ! W#4       R# )r   d:      Nr6   N)r   r   r   rp   r   r   r   )r   r   r   rp   )r   r   r/   )r#   rO   slicedr1   s   &   r&   test_getitem_slice*TestCategoricalIndexing.test_getitem_slicez   sJ    =>Q}}SSz6JK
##F5r)   c                   \        \        P                  P                  ^4      P	                  ^ ^RR7      P                  \        P                  4      4      pVP                  \        P                  ! R.4      P                  \        P                  4      ,          pV\        P                  ! R.4      P                  \        P                  4      ,          P                  p\        P                  ! W#4       R# )r   rS   rT   rV   N)r   r   rW   rX   rY   rZ   r!   r]   r    r\   r   r   )r#   r   r^   r1   s   &   r&   test_getitem_listlike-TestCategoricalIndexing.test_getitem_listlike   s     II!!!$--a-@GGP
 6(+22288<=RXXvh'..rxx89??
##F5r)   c                   \        . RORR7      p\        V4      p\        V4       \        P                  ! . RO\        P
                  R7      p\        . R	ORR7      p\        P                  ! VP                  V4       \        P                  ! VP                  V4       \        . R
ORR7      p\        VRR7      p\        V4       \        P                  ! . RO\        P
                  R7      p\        . R	ORR7      p\        P                  ! VP                  V4       \        P                  ! VP                  V4       \        . RORR7      p\        VRR7      p	\        P                  ! . RO\        P
                  R7      p\        . RORR7      p\        P                  ! V	P                  V4       \        P                  ! V	P                  V4       R# )2014-01Mfreqr   Tr   N)rz   rz   2014-02r~   2014-03r   )r   r   r   r   r   r   )rz   r~   r   )r   r   r~   rz   r   rz   )r   r   r   r   r   r   )2013-122013-112013-102013-092013-082013-072013-05)   rr      rq   r   r   r   )r   r   r   r   r   r   r   )r
   r   strr   r    r!   r   r   r   assert_index_equalr4   )
r#   idx1cat1exp_arrexp_idxidx2cat2exp_idx2idx3cat3s
   &         r&   test_periodindex(TestCategoricalIndexing.test_periodindex   sS   N

 4 D	((-RWW=?cJ
##DKK9
doow7N
 4.D	((-RWW=@sK
##DKK9
doox8 
 4.((0@ 
 	##DKK9
doow7r)   null_valNr	   natNATnanNaNNANc                    \        R RV.RR7      p\        . RORR7      pV^,          \        J g   Q h\        P                  ! W#4       R# )
2022-04-06
2022-04-07Dr|   z	period[D]r   N)r   r   r	   )r
   r	   r   r   )r#   r   r^   r1   s   &&  r&   test_periodindex_on_null_types6TestCategoricalIndexing.test_periodindex_on_null_types   sD     lL(C#NB+VayC
f/r)   new_categoriesc                    \        . 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   zKnew categories need to have the same number of items as the old categories!r>   N)r   r   r   r   )r   rA   rB   
ValueErrorrename_categories)r#   r   rO   rE   s   &&  r&   /test_categories_assignments_wrong_length_raisesGTestCategoricalIndexing.test_categories_assignments_wrong_length_raises   sG    ./% 	 ]]:S11!!.1 2111s   AA!	
idx_values
key_values	key_classr   c                   V! V\        ^^4      R7      pVR8X  d   VP                  p\        WR7      pVP                  V4      w  rxVP                  V4      w  r\        P
                  ! Wy4       \        P
                  ! W4       VP                  4       P                  V4      pVP                  4       P                  V4      p\        P
                  ! W4       R# )r   r6   keyr   N)ranger   r   get_indexer_non_uniquer   r   uniqueget_indexer)r#   r   r   r   r   r   idxr1   exp_missr^   res_miss
exp_unique
res_uniques   &&&&&        r&   test_get_indexer_non_unique3TestCategoricalIndexing.test_get_indexer_non_unique   s     
uQ{;E>IIE J, 77
C55c:
##H5
##H7ZZ\--j9
ZZ\--c2

##J;r)   c                j   \        \        R R.4      4      pVP                  RR.4      p\        \        R R.R R.R7      4      p\        P                  ! W#4       \        \        R R.4      4      pVP                  RR.4      p\        \        RR.R R.R7      4      p\        P                  ! W#4       R# )r   r   TFNr6   )r   r   wherer   assert_series_equalr#   serr^   r1   s   &   r&   test_where_unobserved_nan1TestCategoricalIndexing.test_where_unobserved_nan   s    [#s,-D%=)+sDksCjIJ
v0 [#s,-E5>*+tTlSzJK
v0r)   c                    \        \        . RO. ROR7      4      pVP                  . RORR7      p\        \        . ROVP                  P                  R7      4      p\
        P                  ! W#4       R# )	r   r   r6   )r7   Nrb   rp   r   r   r   )TTF)r   r   r   )r   r   r   rO   r4   r   r   r   s   &   r&    test_where_unobserved_categories8TestCategoricalIndexing.test_where_unobserved_categories   sP    [=QRS.c:+o#''BTBTUV
v0r)   c                    \        \        . RO. ROR7      4      p\        . RO. ROR7      pVP                  . ROV4      p\        \        . R	OVP                  R7      4      p\        P
                  ! W44       R# )
r   r6   r   Nrb   r   r   r   r   r   r   r   rp   TFT)r   r   r   )r   r   r   r   r   r   )r#   r   r7   r^   r1   s   &    r&   test_where_other_categorical4TestCategoricalIndexing.test_where_other_categorical  sU    [=QRSO8LM.6+oSYYGH
v0r)   c                    \        \        . RO4      4      pRp\        P                  ! \        VR7      ;_uu_ 4        VP                  . ROR4       RRR4       R#   + '       g   i     R# ; i)r   z3Cannot setitem on a Categorical with a new categoryr>   rp   Nrb   r   r   r   rA   rB   rC   r   )r#   r   rE   s   &  r&   test_where_new_category_raises6TestCategoricalIndexing.test_where_new_category_raises  sE    [12C]]9C00II)3/ 1000s   AA-	c                
   \        \        . RO. RORR7      4      p\        . RO. R	ORR7      p\        P                  ! \        RR7      ;_uu_ 4        VP                  . R
OV4       RRR4       R#   + '       g   i     R# ; i)r   TrH   zwithout identical categoriesr>   Nrb   r   r   r   r   r   )r#   r   r7   s   &  r&   !test_where_ordered_differs_rasies9TestCategoricalIndexing.test_where_ordered_differs_rasies  sa    4HRVW
 (<d
 ]]9,JKKII)51 LKKKs   A11B	ra   )r   r   rq   r   )r   rq   r   r   )r   rq   rq   r   )r   r   r   r   )Ncategoryr   )rc   rd   re   rf   rt   rw   r   rA   rg   rh   r   r   r	   r   mathr   r   r   r   r   r   r   r   r   r   ri   rj   rk   s   @r&   rn   rn   y   sL    6	638j [[	rvvsB%ueUS0	0 [[-q!f/EF2 G2 [[|\<N [[\QFQFQFQF+KL[[[;8H*IJ[[W&?@< A K M	<&
11102 2r)   rn   c                      a  ] tR tRt o R t]P                  P                  R]! ^ ^4      R3R]! RR4      R3R]	! ^4      R3]
! ^4      R3.]R7      R	 4       tR
 tRtV tR# )TestContainsi  c                   \        \        R 4      \        R4      R7      pRV9   g   Q hRV9  g   Q h\        P                  V9  g   Q h\        P
                  ! \        RR7      ;_uu_ 4        ^.V9   g   Q h RRR4       ^ V9  g   Q h^V9  g   Q h\        . \        R 4      O\        P                  N\        R4      R7      p\        P                  V9   g   Q hR#   + '       g   i     Ll; i)aabbcacabr6   r   zzunhashable type: 'list'r>   N)r   listr   r   rA   rB   rC   rN   s   & r&   test_containsTestContains.test_contains  s    $x.T%[Aczz#~~vvS   ]]9,EFF3#:: G ||||3DN3BFF3ULvv}} GFs   -CC-	zitem, expectedT      ?g      ?F)idsc                l    \        \        P                  ! \        ^4      4      4      pW9   pWBJ g   Q hR# )rq   N)r   r   from_breaksr   )r#   itemr1   rO   r^   s   &&&  r&   test_contains_interval#TestContains.test_contains_interval/  s0     -33E!H=>!!!r)   c                N   \        . RO4      pRV9  g   Q h\        P                  ! \        RR7      ;_uu_ 4        R.V9    RRR4       \        P                  ! \        RR7      ;_uu_ 4        RR.V9    RRR4       R#   + '       g   i     LF; i  + '       g   i     R# ; i)r   r   zunhashable typer>   Nr   )r   r   rq   )r   rA   rB   rC   rN   s   & r&   test_contains_listTestContains.test_contains_listA  su    )$#~~]]9,=>>ESL ? ]]9,=>>#J# ?> ?> ?>>s   B .B B	B$	ra   N)r   T)r   F)rc   rd   re   rf   r   rA   rg   rh   r   r   r   r   r   r   ri   rj   rk   s   @r&   r   r     s     " [[a^T"c3'q\5!q\5!	
   ""
 
r)   r   indexTFc                    \        \        ^4      4      p\        . RO4      pV '       d   \        V4      p\        P
                  ! V4      '       g   Q hW,          pWP                  R4      ,          p\        P                  ! W44       R# )rq   objectNr   )	r   r   r   r   comis_bool_indexerrZ   r   r   r   r   r   r^   r1   s   &    r&   test_mask_with_booleanr   N  se    
q
C
)
*Cs#s####XF::h'(H6,r)   c                     \        \        ^4      4      p\        . RO4      pV '       d   \        V4      pW,          pWP	                  R4      ,          p\
        P                  ! W44       R# )rq   FN)TFN)r   r   r   r   fillnar   r   r   s   &    r&   *test_mask_with_boolean_na_treated_as_falser   [  sP     q
C
)
*Cs#XF::e$%H6,r)   c              #     "   RR lpV P                  4       ;_uu_ 4       pVP                  \        RV4       Rx  RRR4       R#   + '       g   i     R# ; i5i)z
Monkeypatch Categorical.__array__ to ensure no implicit conversion.

Raises
------
ValueError
    When Categorical.__array__ is called.
Nc                     \        R 4      h)zI cannot be converted.)r   )r#   r   s   &&r&   r    (non_coercible_categorical.<locals>.arrayv  s    122r)   	__array__)N)contextsetattrr   )monkeypatchr    ms   &  r&   non_coercible_categoricalr   i  s>     3 
				!			+{E2 
			s   AA
AA		Ac                  n    \        . RO4      p \        V 4      pVP                  ^ ,          pVR 8X  g   Q hR# )r   Nrb   )r   r   at)arrr   r^   s      r&   test_series_atr   ~  s.    
o
&C
+CVVAYFS==r)   )!r   numpyr   rA   pandasr   r   r   r   r   r   r	   r
   r   r   r   pandas._testing_testingr   pandas.core.commoncorecommonr   r   rn   r   rg   rh   r   r   fixturer   r   ra   r)   r&   <module>r     s              _I _IDa2 a2H. .b 4-0	- 1	- 4-0
- 1
-  (r)   