+
    xȇih                         R t ^ RIHtH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HtHtHt ^ RIHt ]P,                  R 4       t ! R R4      t ! R R	4      t ! R
 R4      tR# )z/
See also: test_reindex.py:TestReindexSetIndex
)datetime	timedeltaN)Pandas4Warning)
CategoricalCategoricalIndex	DataFrameDatetimeIndexIndex
MultiIndexSeries
date_rangeperiod_rangeto_datetimec                 H   \        R. ROR. ROR. ROR\        P                  P                  ^4      P	                  ^4      R\        P                  P                  ^4      P	                  ^4      R	\        P                  P                  ^4      P	                  ^4      /4      p V # )
a%  
Fixture for DataFrame of columns that can be used for indexing

Columns are ['A', 'B', 'C', 'D', 'E', ('tuple', 'as', 'label')];
'A' & 'B' contain duplicates (but are jointly unique), the rest are unique.

     A      B  C         D         E  (tuple, as, label)
0  foo    one  a  0.608477 -0.012500           -1.664297
1  foo    two  b -0.633460  0.249614           -0.364411
2  foo  three  c  0.615256  2.154968           -0.834666
3  bar    one  d  0.234246  1.085675            0.718445
4  bar    two  e  0.533841 -0.005702           -3.533912
ABCDE)foor   r   barr   )onetwothreer   r   )abcdetupleaslabel)r   nprandomdefault_rngstandard_normal)dfs    y/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/frame/methods/test_set_index.pyframe_of_index_colsr)      s     
46*&&q)99!<&&q)99!<$bii&;&;A&>&N&Nq&Q	
	
B I    c                     a  ] tR t^:t o R tR tR tR tR tR t	R t
R tR	 t]P                  P                  R
RRRR.R,.4      ]P                  P                  RRR.4      ]P                  P                  RRR.4      R 4       4       4       t]P                  P                  R
RRRR.R,.4      ]P                  P                  RRR.4      R 4       4       t]P                  P                  R
RRRR.R,.4      ]P                  P                  RRR.4      R 4       4       tR t]P                  P                  R]]]P.                  ]R R .4      ]P                  P                  R. R-O4      ]P                  P                  RRR.4      R 4       4       4       t]P                  P                  R]]]P.                  ]R .4      ]P                  P                  R. R.O4      ]P                  P                  RRR.4      R 4       4       4       t]P                  P                  R]]]P.                  ]]R R  .4      ]P                  P                  R!]]]P.                  ]]R" R# .4      ]P                  P                  R. R/O4      ]P                  P                  RRR.4      R$ 4       4       4       4       t]P                  P                  R%RR.4      ]P                  P                  RRR.4      R& 4       4       tR' tR( tR) t R* t!R+t"V t#R# )0TestSetIndexc                    R . ROR. RO/p\        V4      p. ROpW2R&   \        P                  ! VR,          4      pVP                  V4       R# )t1t2tuplesN)   g      @   )         ))       )r6   r1   )r7   r1   )r   r
   from_tuples	set_index)selfr   r'   r0   indexs   &    r(   test_set_index_multiindex&TestSetIndex.test_set_index_multiindex;   sE    ;i0q\)8&&r(|4
Ur*   c                   \        R ^R^ /R ^R^
/R ^R^R^/R ^R^R^/.. ROR7      pVP                  R R.4      pVRR.,          p\        P                  ! VR ,          VR,          .R R.R7      Vn        \
        P                  ! W#4       R# )r   pmxcolumnsnamesN)r   r@   r?   rA   )r   r9   r
   from_arraysr;   tmassert_frame_equal)r:   r'   resultexpecteds   &   r(   test_set_index_empty_column(TestSetIndex.test_set_index_empty_columnF   s    aa ab!ab#r*ab#r*	 )
 sCj)sCj>#//C"S'0B3PS*U
f/r*   c           	        \        R \        RR7      R\        RR7      R. /4      pVP                  R R.4      pVP                  P	                  4       P
                  pVR R.,          P
                  p\        P                  ! W44       R# )r   zdatetime64[ns]dtyper   int64r   N)r   r   r9   r;   to_framedtypesrG   assert_series_equal)r:   df1df2rI   rJ   s   &    r(   test_set_index_empty_dataframe+TestSetIndex.test_set_index_empty_dataframeX   su    &/0#vG7LcSUV
 mmS#J'##%,,Sz?))
v0r*   c                   \         P                  ! . RO4      p\        \        P                  P                  ^4      P                  R4      VR7      pVP                  VP                  ^ ,          4      pVP                  R,          pVP                  R,          P                  Vn        VP                  ^ ,          .VP                  n        \        P                  ! W44       R# )r   rB   N))r   r7   )r   r1   )r   r7   )r2   r2   )NNN:r7   NN)rY   r6   )r
   r8   r   r#   r$   r%   r&   r9   rC   ilocvaluesr;   rE   rG   rH   )r:   rC   r'   rI   rJ   s   &    r(    test_set_index_multiindexcolumns-TestSetIndex.test_set_index_multiindexcolumnsc   s    (()MNII!!!$44V<g
 bjjm,775>-- "

1
f/r*   c                   \        R .RR7      P                  R4      p\        RV/4      pVP                  V4      P                  ^ ,          P
                  ^8X  g   Q h\        \        VP                  4      4      ^ ,          P
                  ^8X  g   Q hVP                  VP                  4      P                  ^ ,          P
                  ^8X  g   Q hR# )z2014-01-01 10:10:10UTCtzzEurope/Romer   N)r   
tz_convertr   r9   r;   hourr   r   )r:   idxr'   s   &  r(   test_set_index_timezone$TestSetIndex.test_set_index_timezonep   s     23>II-XSz"||C &&q).."444VBDD\*1-22b888||BDD!''*//2555r*   c                T   \        R \        R4       Uu. uF   p\        R^^4      \        V4      ,           NK"  	  upR\        P
                  P                  ^4      P                  R4      /4      pVP                  R 4      p\        VP                  \        4      '       g   Q hR# u upi )r   i  i  r   N)r   ranger   r   r#   r$   r%   r&   r9   
isinstancer;   r   )r:   ir'   idfs   &   r(   !test_set_index_cast_datetimeindex.TestSetIndex.test_set_index_cast_datetimeindexy   s    5;O;ahtQ*Yq\99;ORYY**1-==dC
 ll3#))]3333 Ps   &B%
c                   \        R ^RRR7      p\        R. ROR. RO/VR7      P                  4       pVP                  R4      p\        R. ROR. RO/\	        VRR7      R7      pVP
                  P                  R	4      Vn        \        P                  ! W44       VP                  RR.4      p\        P                  ! V. RO.RR.R
7      p\        R. RO/VR7      p\        P                  ! W44       R	# )z2006-10-29 00:00:00h
US/Pacific)periodsfreqra   r   r   )datar;   r;   nameNrD   r;   r6   r7   r1   )r2   r3   r4   )r   r   reset_indexr9   r	   r;   
_with_freqrG   rH   r
   rF   )r:   dir'   resexp	exp_indexs   &     r(   test_set_index_dstTestSetIndex.test_set_index_dst   s    -qs|TS)S)<BGSSUll7#y#y1)
 II((.	
c' llGS>***B	?7C.Q	i(	:
c'r*   c           	        Tp\        \        P                  ! \        V4      ^,
          RR\        P                  R7      4      pVP                  V4      p\        P                  ! VP                  V4       \        P                  ! \        RR7      ;_uu_ 4        VP                  VR,          4       RRR4       R#   + '       g   i     R# ; i)r7   rN   zLength mismatchmatch:NNr1   N)r	   r#   arangelenrP   r9   rG   assert_index_equalr;   pytestraises
ValueError)r:   float_string_framer'   rd   s   &&  r(   test_set_indexTestSetIndex.test_set_index   s    BIIc"gk2rBC\\#
bhh,]]:->??LLS" @???s   B==C	c                   \        \        P                  ! R4      \        \	        R4      \
        R7      \        \        ^
4       Uu. uF  pRV 2NK
  	  up\
        R7      R7      pRVP                  n        VP                  VP                  4      P                  P                  R.8X  g   Q h\        P                  ! VRR.,          P                  P                  RR.R7      p\        P                  ! V. RO,          P                  P                  . ROR7      pVP                  RR.4      pVP                  VP                  4      P                  P                  RR.8X  g   Q h\        VP                  VP                  4      P                  \        4      '       g   Q h\         P"                  ! VP                  VP                  4      P                  V4       VP                  P%                  R	R
.4      p\        VP                  VP                  V.4      P                  \        4      '       g   Q h\         P"                  ! VP                  VP                  V.4      P                  V4       R# u upi )
   ABCDrN   zi-)rC   r;   ru   r   r   rD   r   r   N)r   r3   )r   r   r   r   )r   r   r   r   )r   r#   onesr	   listobjectrh   r;   ru   r9   rE   r
   rF   Tr[   ri   rG   r   rename)r:   rj   r'   mimi2idx2s   &     r(   test_set_index_names!TestSetIndex.test_set_index_names   s   GGG$v,f55959a2aS95VD

 ||BHH%++11fX===##BSzN$4$4$;$;C:N$$#$&&--5I
 \\3*%||BHH%++11c3Z??? ",,rxx066
CCCC 	bll2884::B?xxSz* ",,$'78>>
KKKK 	bllBHHd+;<BBCH9 6s   I4keysr   r   r   inplaceTFdropc                   Tp\        V\        4      '       d0   \        P                  ! V Uu. uF  qeV,          NK  	  upVR 7      pM\	        WT,          VR7      pV'       d   VP                  V^R7      MTpWxn        V'       d+   VP                  4       p	V	P                  WBRR7      p
V
e   Q hMVP                  WBR7      p	\        P                  ! W4       R# u upi )rD   rt   axisT)r   r   N)r   )ri   r   r
   rF   r	   r   r;   copyr9   rG   rH   )r:   r)   r   r   r   r'   rA   rd   rJ   rI   return_values   &&&&&      r(   test_set_index_drop_inplace(TestSetIndex.test_set_index_drop_inplace   s     !dD!!(()>AQ%%)>dKCt,C,02774a7(bWWYF!++DT+JL'''\\$\2F
f/ *?s   Cc                   Tp\        V\        4      '       d   TMV.p\        P                  ! VP                  .V Uu. uF  qTV,          NK  	  up,           R .VOR7      pV'       d   VP                  V^R7      MVP                  4       pWgn        VP                  W2RR7      p\        P                  ! W4       R # u upi )NrD   r   Tr   append)
ri   r   r
   rF   r;   r   r   r9   rG   rH   )	r:   r)   r   r   r'   rA   rd   rJ   rI   s	   &&&&     r(   test_set_index_append"TestSetIndex.test_set_index_append   s     !!$--tD6$$XXJ.AQ%%..tmdm
 -12774a7(bggidd;
f/ /s   B=
c                    VP                  R .VRR7      p\        V\        4      '       d   TMV.pVP                  R .VOVRR7      pVP                  W2RR7      p\        P                  ! We4       R# )r   Tr   N)r9   ri   r   rG   rH   )r:   r)   r   r   r'   rJ   rI   s   &&&&   r(   #test_set_index_append_to_multiindex0TestSetIndex.test_set_index_append_to_multiindex   sp     !**C5tD*I!$--tD6&00#DQU0Vdd;
f/r*   c                   \        R . ROR. RO/4      p\        R ^^./\        RR.RR7      4      pVP                  VP                  P	                  R 4      ,          pVP                  R4      p\        P                  ! WB4       R# )	valkeyr   r   rt   c                     V ^8  # )r7    )indxs   &r(   <lambda><TestSetIndex.test_set_index_after_mutation.<locals>.<lambda>   s    tqyr*   Nrw   )r   r   r   )r   r	   locr;   mapr9   rG   rH   )r:   r'   rJ   rU   rI   s   &    r(   test_set_index_after_mutation*TestSetIndex.test_set_index_after_mutation   sl    y%ABeaV_eS#JU.KLffRXX\\"89:u%
f/r*   boxc                    \        V 4      .# N)r   rA   s   &r(   r   TestSetIndex.<lambda>  s
    tAwir*   c                0    \         P                  ! V .4      # r   r
   rF   r   s   &r(   r   r         j,,aS1r*   zappend, index_nameNc                   TpWFP                   n        V! VR ,          4      pV\        8X  dE   Rp\        P                  ! \
        VR7      ;_uu_ 4        VP                  WrVR7       RRR4       R# \        VRR4      p	V	f   \        VRR4      .MT	p
VP                  WrVR7      pVP                  R .RVR7      pV'       d   V.V
OMT
VP                   n        \        P                  ! W4       R#   + '       g   i     R# ; i)r   z%['one', 'two', 'three', 'one', 'two']r   r   NrE   ru   F)r;   ru   r   r   r   KeyErrorr9   getattrrE   rG   rH   )r:   r)   r   r   
index_namer   r'   r   msgname_miru   rI   rJ   s   &&&&&&       r(    test_set_index_pass_single_array-TestSetIndex.test_set_index_pass_single_array  s    $ !""S'l$;9Cxs33SF; 43 c7D1G3:?GC./D\\#\@F ||SEf|EH:@J#6#6dHNN !!&3 433s   C00D	c                0    \         P                  ! V .4      # r   r   r   s   &r(   r   r   0  s    9O9OQRPS9Tr*   c                   TpWFP                   n        R V! VR,          4      .pR V\        P                  \        \
        \        39   d   RMR.pVP                  WrVR7      p	VP                  R R.RVR7      p
V'       d   V
P                  R ^R7      MT
p
V'       d   V.VOMTV
P                   n	        \        P                  ! W4       R# )r   r   Nr   Fr   )r;   ru   r#   arrayr   r    iterr9   r   rE   rG   rH   )r:   r)   r   r   r   r   r'   r   rE   rI   rJ   s   &&&&&&     r(   test_set_index_pass_arrays'TestSetIndex.test_set_index_pass_arrays/  s     !"SC\"cbhheT%BBdLdf= <<c
v<F158==1=-87=
3U35
f/r*   box2c                0    \         P                  ! V .4      # r   r   r   s   &r(   r   r   V  r   r*   c                    V P                   # r   rt   r   s   &r(   r   r   W      affr*   box1c                0    \         P                  ! V .4      # r   r   r   s   &r(   r   r   b  r   r*   c                    V P                   # r   rt   r   s   &r(   r   r   c  r   r*   c                   TpWGP                   n        V! VR ,          4      V! VR ,          4      .pVP                  WVR7      p	V! VR ,          4      V! VR ,          4      .p\        V^ ,          \        4      '       d<   V^ ,          R 8X  d.   \        V^,          \        4      '       d   V^,          R 8X  d   RMTp
VP                  V^ ,          .WR7      pVP                  V^,          .VRR7      p\
        P                  ! W4       R# )r   r   FTN)r;   ru   r9   ri   strrG   rH   )r:   r)   r   r   r   r   r   r'   r   rI   
first_droprJ   s   &&&&&&&     r(   $test_set_index_pass_arrays_duplicate1TestSetIndex.test_set_index_pass_arrays_duplicateN  s    > !"RWtBsG}-df= RWtBsG}- 47C((GsNtAw,,GsN   	 <<a	
<J%%tAwid4%H
f/r*   r   c                    Tp\         P                  ! VR ,          VR,          .R R.R7      pVP                  WRVR7      pVP                  R R.RVR7      p\        P                  ! Wg4       R# )r   r   rD   r   FN)r
   rF   r9   rG   rH   )r:   r)   r   r   r'   r   rI   rJ   s   &&&&    r(   test_set_index_pass_multiindex+TestSetIndex.test_set_index_pass_multiindex  sf     !%%r#w3&8c
Kdf= <<c
v<F
f/r*   c                   \        \        R 4      ^,          RR7      p\        R\        P                  P                  ^4      P                  ^
4      RVP                  /4      pVP                  R4      p\        P                  ! VP                  V4       \        R\        P                  P                  ^4      P                  ^
4      RV/4      pVP                  R4      p\        P                  ! VP                  V4       VP                  4       P                  R4      p\        P                  ! VP                  V4       R# )abr   rt   r   N)r   r   r   r#   r$   r%   r&   r[   r9   rG   r   r;   rx   )r:   cir'   rk   s   &   r(   (test_construction_with_categorical_index5TestSetIndex.test_construction_with_categorical_index  s    d4j1n37 "))''*::2>RYYO
 ll3
cii, RYY2215EEbI3PRSTll3
cii, oo))#.
cii,r*   c                v   \        R . ROR. ROR\        \        R4      \        R4      RR7      R\        \        R4      \        R4      RR7      /4      pRRR R.R R.RR.3 FT  pVP                  V4      P	                  4       pVP                  VP                  R	7      p\        P                  ! W14       KV  	  R
# )r   r   C1abaabbacF)
categoriesorderedC2TrB   N)r7   r1   r7   r7   r1   )r            "   )	r   r   r   r9   rx   reindexrC   rG   rH   )r:   r'   colsrI   s   &   r(   )test_set_index_preserve_categorical_dtype6TestSetIndex.test_set_index_preserve_categorical_dtype  s    _)k$w-DKQVWk$w-DKQUV	
 4#tsDkD$<HD\\$'335F^^BJJ^7F!!&- Ir*   c           
        \        R . ROR. ROR\        ^4      /4      p\        VP                  R4      RR7      Vn        VP                  P                  R4      Vn        \        . RORR7      pVP                  R	4      P                  R4      pVP                  R RR
7      p\        P                  ! VP                  P                  ^ ,          V4       \        P                  ! VP                  P                  ^,          \        RR.R R7      4       VP                  P                  RR .8X  g   Q hVP                  ^ ^4      p\        P                  ! VP                  P                  ^ ,          \        RR.R R7      4       \        P                  ! VP                  P                  ^,          V4       VP                  P                  R R.8X  g   Q h\        \        P                   P#                  ^4      P!                  ^4      4      p\        . RORR7      p\        . RORR7      p\%        R^RR7      pVP'                  R4      pVP                  V4      pVP                  VRR
7      pVP                  VRR
7      p\        . RORR7      p\        RR.RR7      p\        P                  ! VP                  P                  ^ ,          V4       \        P                  ! VP                  P                  ^,          V4       \        P                  ! VP                  P                  ^,          V4       \        P                  ! VP                  P)                  ^ 4      V4       \        P                  ! VP                  P)                  ^4      V4       \        P                  ! VP                  P)                  ^4      V4       R# )r"   r   r   r   valueT)utcrp   rt   r_   r   z
US/Easternr`   2012-04-01 09:002012-04-02 09:00z2011-01-01 09:00z
Asia/Tokyo)rq   ra   N)r   r   r   r   r   r   )2011-07-19 07:00:002011-07-19 08:00:002011-07-19 09:00:00r   r   r   )r   r   r   )r   r   r   r   r   r   )r   rh   r   popr;   rb   r   tz_localizer9   rG   r   levelsr	   rE   	swaplevelr#   r$   r%   r   ry   get_level_values)r:   r'   rJ   idx1r   idx3	expected1	expected2s   &       r(   test_set_index_datetime$TestSetIndex.test_set_index_datetime  s   7  q
 rvvj1t<88&&|4 Q
 ''.99,G\\'$\/
bhhooa0(;
bhhooa0%c
2QRxx~~*g!6666\\!Q
bhhooa0%c
2QR
bhhooa0(;xx~~':!6666ryy,,Q/66q9: 

  

 ,aLIt$\\$\\$t\,\\$t\,!Q
	 "!34
	 	bhhooa0)<
bhhooa0)<
bhhooa0$7 	bhh77:DA
bhh77:DA
bhh77:DAr*   c                   \        \        P                  P                  ^4      P                  ^4      4      p\	        R^RR7      pVP                  V4      p\	        R^RR7      pVP                  V4      P                  V4      p\	        R^RR7      pVP                  V4      pVP                  VRR	7      pVP                  VRR	7      p\	        R^RR7      p\	        R^RR7      p\        P                  ! VP                  P                  ^ ,          V4       \        P                  ! VP                  P                  ^,          V4       \        P                  ! VP                  P                  ^,          V4       \        P                  ! VP                  P                  ^ 4      V4       \        P                  ! VP                  P                  ^4      V4       \        P                  ! VP                  P                  ^4      V4       R
# )r1   z
2011-01-01Mrq   rr   z2013-01-01 09:00ro   2005YTr   N)r   r#   r$   r%   r   r   r9   rG   r   r;   r   r   )r:   r'   r   r   r   r  r  s   &      r(   test_set_index_period"TestSetIndex.test_set_index_period  s{   ryy,,Q/66q9:L!#>{{4 .D{{4 ''-FAC8\\$\\$t\,\\$t\, qsC	 !3QSI	
bhhooa0)<
bhhooa0)<
bhhooa0$7
bhh77:DA
bhh77:DA
bhh77:DAr*   r   r   )TNTr   TtestFN)r  Tr   r  r  r  )r  r  r  r  )$__name__
__module____qualname____firstlineno__r<   rK   rV   r\   re   rl   r~   r   r   r   markparametrizer   r   r   r   r   r	   r#   r   r   r   r   r   r   r   r   r   r  r
  __static_attributes____classdictcell____classdict__s   @r(   r,   r,   :   s_    	0$	106	4(&# IF [[Vc3c
<T%UV[[Yu6[[VdE]30 4 7 W0( [[Vc3c
<T%UV[[VdE]30 4 W0 [[Vc3c
<T%UV[[VdE]3	0 4 W	00 [[HH1	

 [[X [[VdE]34 4
48 [[rxx/TU [[O [[VdE]30 4	0. [[HH1	
 [[HH1	
 [[X [[VdE]30 480@ [[Xe}5[[VdE]3	0 4 6	0-&.PBdB Br*   r,   c                   t  a  ] tR tRt o R t]P                  P                  RRR.4      ]P                  P                  RRR.4      R 4       4       t]P                  P                  RRR.4      ]P                  P                  RRR.4      R 4       4       t	]P                  P                  R	]
]]P                  ]R
 .. ROR7      ]P                  P                  R^^.RR.R7      ]P                  P                  RRR.4      ]P                  P                  RRR.4      R 4       4       4       4       tRtV tR# )TestSetIndexInvalidi$  c           	     |   TpR p\         P                  ! \        RR7      ;_uu_ 4        \        P                  ! \
        VR7      ;_uu_ 4        VP                  RRR7       RRR4       RRR4       \         P                  ! \        RR7      ;_uu_ 4        \        P                  ! \
        VR7      ;_uu_ 4        VP                  VR,          VR,          .RR7       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L@; i  + '       g   i     R# ; i)z5The 'verify_integrity' keyword in DataFrame.set_indexzIndex has duplicate keysr   r   T)verify_integrityN)r   r   r   rG   assert_produces_warningr   r9   )r:   r)   r'   r   s   &&  r(   test_set_index_verify_integrity3TestSetIndexInvalid.test_set_index_verify_integrity%  s     E]]:-GHH++N#FFS48 G I ]]:-GHH++N#FFbgr#w/$G G IH GF IH
 GF IHHsG   %DC1	"D%D*;$D	D*1D<DD	D'"D**D;	r   TFr   c           
     $   Tp\         P                  ! \        R R7      ;_uu_ 4        VP                  . ROW#R7       RRR4       \         P                  ! \        RR7      ;_uu_ 4        VP                  VR,          VR,          R.W#R7       RRR4       Rp\         P                  ! \        VR7      ;_uu_ 4        VP                  \	        VR,          4      W#R7       RRR4       \         P                  ! \        VR7      ;_uu_ 4        VP                  RVR,          \	        VR,          4      .W#R7       RRR4       R#   + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)	z['foo', 'bar', 'baz']r   r   NXr   r   z%[('foo', 'foo', 'foo', 'bar', 'bar')])r   r   baz)r   r   r   r9   r    )r:   r)   r   r   r'   r   s   &&&&  r(   test_set_index_raise_keys-TestSetIndexInvalid.test_set_index_raise_keys1  s    !]]8+BCCLL.TLI D
 ]]83//LL"S'2c7C0tLK 0 6]]83//LLr#wdLB 0 ]]83//LL#r#wbg7dLR 0/ DCC
 0/
 0/ 0//s/   E)%E<$E+.E>E	E(	+E;	>F	c           
        \         pTpR p\        P                  ! \        VR7      ;_uu_ 4        VP	                  V! VR,          4      W#R7       RRR4       \        P                  ! \        VR7      ;_uu_ 4        VP	                  RVR,          V! VR,          4      .W#R7       RRR4       R#   + '       g   i     Li; i  + '       g   i     R# ; i),The parameter "keys" may be a column key, .*r   r   r   N)setr   r   	TypeErrorr9   )r:   r)   r   r   r   r'   r   s   &&&&   r(   test_set_index_raise_on_type0TestSetIndexInvalid.test_set_index_raise_on_typeG  s      <]]9C00LLRWDL@ 1 ]]9C00LL#r#wBsG5DLP 10	 10 100s   !B1<+C1C	C	r   c                0    \         P                  ! V .4      # r   r   r   s   &r(   r   TestSetIndexInvalid.<lambda>Y  s    *2H2H!2Mr*   )idslength	too_shorttoo_longc           	        Tp\         P                  P                  ^4      P                  ^ ^
V34      pRp\        P
                  ! \        VR7      ;_uu_ 4        VP                  V! V4      WER7       RRR4       \        P
                  ! \        VR7      ;_uu_ 4        VP                  RVP                  V! V4      .WER7       RRR4       R#   + '       g   i     Le; i  + '       g   i     R# ; i)r1   z<Length mismatch: Expected 5 rows, received array of length.*r   r   Nr   )	r#   r$   r%   integersr   r   r   r9   r   )	r:   r)   r   r1  r   r   r'   r[   r   s	   &&&&&&   r(   test_set_index_raise_on_len/TestSetIndexInvalid.test_set_index_raise_on_lenW  s     !&&q)221b6)DL ]]:S11LLV4L? 2 ]]:S11LL#rttS[1LL 21	 21 211s   C 'C$C!	$C5	r   N)r   r	   znp.arrayr   r
   )r  r  r  r  r!  r   r  r  r&  r,  r   r	   r#   r   r   r6  r  r  r  s   @r(   r  r  $  sB    
H [[Xe}5[[VdE]3S 4 6S( [[Xe}5[[VdE]3Q 4 6Q [[	$(MNA  
 [[X1vK3LM[[Xe}5[[VdE]3M 4 6 NMr*   r  c                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )TestSetIndexCustomLabelTypeir  c                    ! R  R4      pV! RR4      pV! RR4      p\        V^ ^.V^^./4      p\        V^ ^./\        ^^.VR7      R7      pVP                  V4      p\        P                  ! We4       VP                  V.4      p\        P                  ! We4       V! RR	4      pR
p\
        P                  ! \        VR7      ;_uu_ 4        VP                  V4       RRR4       \
        P                  ! \        VR7      ;_uu_ 4        VP                  V.4       RRR4       R#   + '       g   i     LQ; i  + '       g   i     R# ; i)c                   H   a  ] tR tRt o V 3R lR ltV 3R lR lt]tRtV tR# )KTestSetIndexCustomLabelType.test_set_index_custom_label_type.<locals>.Thingiv  c                   < V ^8  d   QhRR/# r1   returnNr   )formatr  s   "r(   __annotate__XTestSetIndexCustomLabelType.test_set_index_custom_label_type.<locals>.Thing.__annotate__w       # #t #r*   c                    Wn         W n        R # r   ru   colorr:   ru   rF  s   &&&r(   __init__TTestSetIndexCustomLabelType.test_set_index_custom_label_type.<locals>.Thing.__init__w       	"
r*   c                    < V ^8  d   QhRS[ /# r1   r?  r   )r@  r  s   "r(   rA  rB  {       0 0 0r*   c                $    R V P                   : R2# z<Thing >rt   r:   s   &r(   __str__STestSetIndexCustomLabelType.test_set_index_custom_label_type.<locals>.Thing.__str__{       Q//r*   rF  ru   N)	r  r  r  r  rH  rS  __repr__r  r  r  s   @r(   Thingr<  v  s      # #0 0 Hr*   rX  OneredTwobluert   rv   Threepinkz<Thing 'Three'>r   N)r   r	   r9   rG   rH   r   r   r   	r:   rX  thing1thing2r'   rJ   rI   thing3r   s	   &        r(    test_set_index_custom_label_type<TestSetIndexCustomLabelType.test_set_index_custom_label_types  s   		 		 ue$uf%AA78fq!f-UAq65OP f%
f/ vh'
f/ w']]83//LL  0 ]]83//LL&" 0/	 0/ 0//s   D'
D:'D7	:E	c                    ! R  R\         4      pV! RR.4      pV! RR.4      p\        V^ ^.V^^./4      p\        V^ ^./\        ^^.VR7      R7      pVP                  V4      p\        P
                  ! We4       VP                  V.4      p\        P
                  ! We4       V! RR	.4      pR
p\        P                  ! \        VR7      ;_uu_ 4        VP                  V4       RRR4       \        P                  ! \        VR7      ;_uu_ 4        VP                  V.4       RRR4       R#   + '       g   i     LQ; i  + '       g   i     R# ; i)c                   2   a  ] tR tRt o V 3R lR ltRtV tR# )XTestSetIndexCustomLabelType.test_set_index_custom_label_hashable_iterable.<locals>.Thingi  c                    < V ^8  d   QhRS[ /# rL  rM  )r@  r  s   "r(   rA  eTestSetIndexCustomLabelType.test_set_index_custom_label_hashable_iterable.<locals>.Thing.__annotate__  s     8 8# 8r*   c                b    \        V 4      pR P                  \        \        V4      4      pRV R2# )z, zfrozenset({z}))sortedjoinr   repr)r:   tmpjoined_reprss   &  r(   rW  aTestSetIndexCustomLabelType.test_set_index_custom_label_hashable_iterable.<locals>.Thing.__repr__  s.    Tl#yyT38%l^377r*   r   N)r  r  r  r  rW  r  r  r  s   @r(   rX  rg    s     8 8r*   rX  rY  rZ  r[  r\  rt   rv   r]  r^  z frozenset\(\{'Three', 'pink'\}\)r   N)		frozensetr   r	   r9   rG   rH   r   r   r   r_  s	   &        r(   -test_set_index_custom_label_hashable_iterableITestSetIndexCustomLabelType.test_set_index_custom_label_hashable_iterable  s   	8I 	8 u~&v'AA78fq!f-UAq65OP f%
f/ vh'
f/ ()1]]83//LL  0 ]]83//LL&" 0/	 0/ 0//s   D/E/D?	E	c                    ! R  R\         4      pV! RR4      pV! RR4      p\        ^ ^.^^..W#.R7      pRp\        P                  ! \        VR7      ;_uu_ 4        VP                  V4       R	R	R	4       \        P                  ! \        VR7      ;_uu_ 4        VP                  V.4       R	R	R	4       R	#   + '       g   i     LQ; i  + '       g   i     R	# ; i)
c                   D   a  ] tR tRt o V 3R lR ltV 3R lR ltRtV tR# )RTestSetIndexCustomLabelType.test_set_index_custom_label_type_raises.<locals>.Thingi  c                   < V ^8  d   QhRR/# r>  r   )r@  r  s   "r(   rA  _TestSetIndexCustomLabelType.test_set_index_custom_label_type_raises.<locals>.Thing.__annotate__  rC  r*   c                    Wn         W n        R # r   rE  rG  s   &&&r(   rH  [TestSetIndexCustomLabelType.test_set_index_custom_label_type_raises.<locals>.Thing.__init__  rJ  r*   c                    < V ^8  d   QhRS[ /# rL  rM  )r@  r  s   "r(   rA  rx    rN  r*   c                $    R V P                   : R2# rP  rt   rR  s   &r(   rS  ZTestSetIndexCustomLabelType.test_set_index_custom_label_type_raises.<locals>.Thing.__str__  rU  r*   rV  N)r  r  r  r  rH  rS  r  r  r  s   @r(   rX  rv    s     # #0 0r*   rX  rY  rZ  r[  r\  rB   r)  r   N)r*  r   r   r   r+  r9   )r:   rX  r`  ra  r'   r   s   &     r(   'test_set_index_custom_label_type_raisesCTestSetIndexCustomLabelType.test_set_index_custom_label_type_raises  s    	0C 	0 ue$uf%AA'&1AB<]]9C00LL  1 ]]9C00LL&" 10	 10 100s   B7C
7C	
C	c                t   \        \        P                  P                  ^4      P                  ^4      4      p\	        R^RR7      p\	        R^RR7      pVP                  V4      p\        P                  ! VP                  V4       VP                  V4      p\        P                  ! VP                  V4       R# )r1   z
2011/01/01r  r  2013r	  N)	r   r#   r$   r%   r   r9   rG   r   r;   )r:   r'   r   r   s   &   r(   test_set_index_periodindex6TestSetIndexCustomLabelType.test_set_index_periodindex  s    ryy,,Q/66q9:L!#>FAC8\\$
bhh-\\$
bhh-r*   r   N)
r  r  r  r  rc  rr  r~  r  r  r  r  s   @r(   r9  r9  r  s      $#L%#N#4	. 	.r*   r9  )__doc__r   r   numpyr#   r   pandas.errorsr   pandasr   r   r   r   r	   r
   r   r   r   r   pandas._testing_testingrG   fixturer)   r,   r  r9  r   r*   r(   <module>r     sp   
   (     6gB gBTKM KM\q. q.r*   