
    zhh                     p   d Z ddlmZ ddlZddlZddlZddlmZ ddlm	c m
Z ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZ ddlm Z  ddl!m"Z"  ej#        d          Z$ G d	 d
          Z% G d d          Z& G d d          Z' G d d          Z( G d d          Z) G d d          Z*dS )z* test positional based indexing with iloc     )datetimeN)IndexingError)NACategoricalCategoricalDtype	DataFrameIndexIntervalNaTSeries	Timestamparrayconcat
date_rangeinterval_rangeisnato_datetime)	is_scalar)"check_indexing_smoketest_or_raiseszuonly integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indicesc                       e Zd Zej                            dddg dg          ej                            dddg          ej                            dg d	          d
                                     ZdS )TestiLockey   r      r   kindseriesframecol)labelsmixedtsfloatsemptyc                 j    |                     | d|           }t          |d|t                     d S )N_iloc)fails)getfixturevaluer   
IndexError)selfr   r   r    requestobjs         V/var/www/histauto/venv/lib/python3.11/site-packages/pandas/tests/indexing/test_iloc.py"test_iloc_getitem_int_and_list_intz+TestiLoc.test_iloc_getitem_int_and_list_int)   sN     %%oooo66*		
 	
 	
 	
 	
 	
    N)__name__
__module____qualname__pytestmarkparametrizer0    r1   r/   r   r   (   s        [UQIII$677[Vh%899[444 
 
	  :9 87
 
 
r1   r   c                   ~   e Zd ZdZej                            d ed           ed           ed          g d e	 ed                     e
j        g d          g          ej                            dej        ej        g          d                         Zej                            d          ej                            d	d
dg          ej                            deeg          d                                     Zd Zd Zej                            d e
j        d           ed          fg          ej                            d ed          ddggddg ed          f eddd          g ed          fg          d                         Zd Zd Zd Zd Zd Zd  Zej                            d!d
dgg d"g          d#             Z d$ Z!d% Z"ej                            d          ej                            d	d
dg          d&                         Z#ej                            d          ej                            d	d
dg          d'                         Z$ej                            d          ej                            d	d
dg          d(                         Z%d) Z&d* Z'd+ Z(d, Z)d- Z*d. Z+ej                            d          ej                            d	d
dg          d/                         Z,ej                            d          ej                            d	d
dg          d0                         Z-ej                            d          ej                            d	d
dg          ej                            dd1g eddd           e
j        d1g          g          ej                            d2d3g e
j        d3g          g          d4                                                 Z.ej                            d5          d6             Z/d7 Z0d8 Z1d9 Z2d: Z3d; Z4d< Z5d= Z6d> Z7d? Z8ej                            d2de9e
j:        g          d@             Z;ej                            dA e<d1d          dBdCg          dD             Z=dE Z>ej                            dej        ej        g          dF             Z?dG Z@dH ZAej                            dIee
j        g          dJ             ZBej                            d          ej                            d	d
dg          ej                            ddg eddK          g          dL                                     ZCej                            d          ej                            d	d
dg          dM                         ZDdN ZEdO ZFdP ZGdQ ZHdR ZIej                            dSee
j        g          ej                            dTee
j        g          dU                         ZJdV ZKdW ZLeMjN        dX             ZOdY ZPdS )ZTestiLocBaseIndependentzTests Independent Of Base Classr   N   r   indexerc                    t          dt          d          it                    }t          g d          }|s'|j        j        d                             |          sJ |                                }|j        }| ||          |df<   t          d|i          	                    t                    }|s"t          j        |d         j        |          sJ t          j        ||           d|j        d<   |d         dk    sJ t          t          j        g dt                    t          d          d          }|                                }| ||          |df<   t          t!          |	                    t                    t                    t          d          d          }t          j        ||           d S )	Nr   r;   dtype)alphabetagammarB   r   r   r   r   r   )r   rangeobjectr   _mgrblocks_can_hold_elementcopyvaluesastypenpshares_memorytmassert_frame_equalr(   r   r   )	r,   r<   r   using_array_managerr   catdf	orig_valsexpecteds	            r/   %test_iloc_setitem_fullcol_categoricalz=TestiLocBaseIndependent.test_iloc_setitem_fullcol_categorical?   s    1eAhh-v66644455" 	?:$Q'99#>>>>>ZZ\\I	!CFaX&&--f55" 	=#BqEL)<<<<<
b(+++  1v    
 bhyyy???E!HHMMNNZZ\\!CF

6(:(:&!I!I!IeTUhhWWXX
b(+++++r1   .ignore:Setting a value on a view:FutureWarninghas_refTFboxc                    t          g d          } ||                    d                    }|r
|d d          }|t          u r|j        }n|j        j        d         }|t          u r ||dd                    |j        d d<   n ||dd                    |j        d ddf<    |t          j         g dd                    }	t          j	        ||	           |sc|t          u r8|r)|j        |usJ t          j
        |j        |          sJ d S |j        |u sJ d S t          j
        |d         j        |          sJ d S d S )Nr   r   r;      i8r   r   )r;   r\   r;   r\   r>   )r   to_numpyr   rK   rG   arraysr(   rM   rO   assert_equalrN   )
r,   frame_or_seriesrY   rX   using_copy_on_writearrr.   viewrK   rU   s
             r/   test_iloc_setitem_ea_inplacez4TestiLocBaseIndependent.test_iloc_setitem_ea_inplacek   s    LLL!!ocll40011 	qqq6Df$$ZFFX_Q'Ff$$3s122w<<CHRaRLL!c#abb'llCHRaRUO"?28LLL#E#E#EFF
X&&&  	?&((& 0:V3333+CJ???????://////'Av>>>>>	? 	? ?>r1   c                     t          g d          }t          t          d          |          }|j                            d          sJ |                                }|j                            d          sJ d S )N)r   r   r   r;   index)r   r   r   )r	   r   rE   r(   _is_scalar_accessto_frame)r,   rh   serrS   s       r/   test_is_scalar_accessz-TestiLocBaseIndependent.test_is_scalar_access   sv    iii  U1XXU+++x))$/////\\^^w((0000000r1   c           
         t          t          j                            d                              d          t	          d                    }d}t          j        t          |          5  |j        d d g df          d d d            n# 1 swxY w Y   t          j        t          |          5  |j        dd	g          d d d            n# 1 swxY w Y   t          j        t          |          5  |j        dd
g          d d d            n# 1 swxY w Y   t          j        t          |          5  |j        dg          d d d            n# 1 swxY w Y   |d         }t          j        t          |          5  |j        dg          d d d            n# 1 swxY w Y   t          j        t          |          5  |j        dg          d d d            n# 1 swxY w Y   d}t          j        t          |          5  |j        d	          d d d            n# 1 swxY w Y   t          j        t          |          5  |j        d
          d d d            n# 1 swxY w Y   t          j        t          |          5  |j        d	          d d d            n# 1 swxY w Y   t          j        t          |          5  |j        d
          d d d            n# 1 swxY w Y   |j        d d ddf         }|j        d d dd f         }t          j
        ||           |j        d d ddf         }|j        d d d df         }t          j
        ||           |j        d d dddf         }|j        d d d ddf         }t          j
        ||           |j        d d dddf         }|j        d d dd df         }t          j
        ||           |j        d d ddf         }|j        d d d df         }t          j
        ||           |j        d d ddf         }|j        d d d df         }t          j
        ||           |j        d d dddf         }|j        d d d df         }t          j
        ||           |j        d d ddf         }|j        d d d df         }t          j
        ||           |j        dd	         }|j        dd          }t          j        ||           |j        d	d          }|j        d d         }t          j        ||           |j        d	d d         }|j        d d d         }t          j        ||           t          t          j                            d                              d          t	          d                    }t          j
        |j        d d ddf         t          |j        t          g |j        j                                       t          j
        |j        d d ddf         |j        d d dgf                    t          j
        |j        dd         |j        dg                    d}t          j        t          |          5  |j        g d          d d d            n# 1 swxY w Y   d}t          j        t          |          5  |j        d d df          d d d            d S # 1 swxY w Y   d S )Nr   )      ABCDEcolumnsz%positional indexers are out-of-boundsmatchr   r   r   r;   r\   rp   r      id   Aiz*single positional indexer is out-of-boundsr\   
   ir   r   i      rp   r   ABr;   r>   rh   rs      r\   rp   r   )r   rM   randomdefault_rnglistr5   raisesr+   r(   rO   rP   assert_series_equalstandard_normalrh   r	   rs   r?   )r,   rS   msgsresultrU   dfls          r/   test_iloc_exceeds_boundsz0TestiLocBaseIndependent.test_iloc_exceeds_bounds   s	    ry,,Q//66w??gWWW 6]:S111 	+ 	+GAAA))))**	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+]:S111 	 	GQG	 	 	 	 	 	 	 	 	 	 	 	 	 	 	]:S111 	 	GQH	 	 	 	 	 	 	 	 	 	 	 	 	 	 	]:S111 	 	GSENN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 sG]:S111 	 	FC5MM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	]:S111 	 	FD6NN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ;]:S111 	 	GBKK	 	 	 	 	 	 	 	 	 	 	 	 	 	 	]:S111 	 	GCLL	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ]:S111 	 	F2JJ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	]:S111 	 	F3KK	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 AbD!7111abb5>
fh///BsF#7111bqb5>
fh///BqG$7111eqe8$
fh///Ac"H%7111aee8$
fh///CE"7111bqb5>
fh///BqD!7111bqb5>
fh///CBJ'7111bqb5>
fh///BrE"7111bqb5>
fh/// 26"##;
vx0006"1":
vx000B6$$B$<
vx000 I!!!$$44V<<d4jj
 
 
 	HQQQ!VCIuRs{?P/Q/Q/QRRR	
 	
 	
 	chqqq!A#v.QC0@AAA
chqsmSXqc];;;5]:S111 	  	 HYYY	  	  	  	  	  	  	  	  	  	  	  	  	  	  	 :]:S111 	 	HQQQTNN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   ,BBB2CCC4DDD6EEE?FF!F GG"GHH!$H!II!$I!JJ!$J!KK!$K!ZZ"%Z"[%%[),[)zindex,columnsro   rq   zindex_vals,column_valsry   D12i  r   c                 L   t          t          j                            d                              t          |          t          |          f          ||          }d}t          j        t          |          5  |j	        ||f          d d d            d S # 1 swxY w Y   d S )Nr   r   z$.iloc requires numeric indexers, gotrt   )
r   rM   r   r   r   lenr5   r   r+   r(   )r,   rh   rs   
index_valscolumn_valsrS   r   s          r/   test_iloc_non_integer_raisesz4TestiLocBaseIndependent.test_iloc_non_integer_raises   s     I!!!$$44c%jj#g,,5OPP
 
 

 5]:S111 	- 	-GJ+,,	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	-s   <BB Bc                    t          t          j        d                              dd                    }t	          j        ||          }t          j        t          d          5  |j	        d          d d d            d S # 1 swxY w Y   d S )Nrx   rz   zCannot index by location indexrt   a)
r   rM   arangereshaperO   get_objr5   r   	TypeErrorr(   )r,   ra   r.   s      r/    test_iloc_getitem_invalid_scalarz8TestiLocBaseIndependent.test_iloc_getitem_invalid_scalar  s     	#..r26677jo..]9,LMMM 	 	HSMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   &BBBc                 $   t          j        g d          }|                                }t          g dg dg ddg d          }|j        |          t          j        ||           |j        d d |f          t          j        ||           d S )N)r   r   r   )rx   e   f   )g   h   i   )j   k   l   ry   BCr   r   r;   rg   )rM   r   rJ   r   r(   rO   assert_numpy_array_equal)r,   array_with_neg_numbers
array_copyrS   s       r/   -test_iloc_array_not_mutating_negative_indiceszETestiLocBaseIndependent.test_iloc_array_not_mutating_negative_indices  s    !#***!5!5+0022
!//oooNN))
 
 
 	&''
#$:JGGG
))**
#$:JGGGGGr1   c                    t          g dg dd          }|d         }|j        d         }|j        d         }t          j        ||           |j        dg         }|j        dg         }t          j        ||           |j        d         }|j        d         }||k    sJ |j        dg         }|j        dg         }t          j        ||           t          dgdg          }|j        d	g         }t          j        ||           d S )
N)r   r;   rp   )   r|      ry   r   ry   r   r   rg   r   )r   r(   rO   r   rP   r   )r,   rS   r   rU   r   s        r/   /test_iloc_getitem_neg_int_can_reach_first_indexzGTestiLocBaseIndependent.test_iloc_getitem_neg_int_can_reach_first_index)  s    YYY[[[99::sG71:
vx0007A3<"
fh///6!9!!!!61#;
vx000 3%u---t$
vx00000r1   c                 T   t          d dddddg          }t          ddddddg          }t          ||gd          }|j        d         }t          |          sJ |j        dd d f         }t	          t
          j        dddgg d	d
          }t          j        ||           d S )Nr   r   r   r;   r\   axisrC   r   ry   r   ry   r   )rh   name)	r   r   r(   r   r   rM   nanrO   r   )r,   df1df2rS   r   rU   s         r/   test_iloc_getitem_dupsz.TestiLocBaseIndependent.test_iloc_getitem_dupsD  s    t!,,AA.>.>?@@qq))+;+;<==S#JQ''' F||AAA261a+3G3G3GaPPP
vx00000r1   c                    t          dddddddddd	d
dg          }t          ddddg          }t          j        |j        dg         |           t          ddddddddg          }t          j        |j        ddg         |           t          dddd	d
dgddg          }|j        ddgddgf         }t          j        ||           d S )Nr   r   r;   r   rx      ,        r   )r   r   rg   )r   rO   rP   r(   r,   rS   rU   r   s       r/   test_iloc_getitem_arrayz/TestiLocBaseIndependent.test_iloc_getitem_arrayR  s   aa((#..D11
 
 AAA66788
bgqclH555AAA66cRU8V8VWXX
bgq!fox888AA..d0F0FGPQSTvVVV!Q!Q(
fh/////r1   c                 <   t          dddddddddd	d
dg          }t          ddddddddg          }|j        g d         }t          j        ||           t          dddddd	d
dgddg          }|j        d          }t          j        ||           d S )Nr   r   r;   r   rx   r   r   r   r   r   )TTFr   rg   c                     | j         dz  dk    S )Nr   r   rg   xs    r/   <lambda>z@TestiLocBaseIndependent.test_iloc_getitem_bool.<locals>.<lambda>u  s    17Q;!#3 r1   r   r(   rO   rP   r   s       r/   test_iloc_getitem_boolz.TestiLocBaseIndependent.test_iloc_getitem_boole  s    aa((#..D11
 
 AAA66cRU8V8VWXX,,,-
fh///11%%T4'H'HIRSUVQW
 
 
 334
fh/////r1   rh   )TFTFc                     t          g d          }dt          |           dt          |           }t          j        t          |          5  |j        |          d d d            d S # 1 swxY w Y   d S )Nr   z Boolean index has wrong length: z instead of rt   )r   r   r5   r   r+   r(   )r,   rh   r   r   s       r/   test_iloc_getitem_bool_diff_lenz7TestiLocBaseIndependent.test_iloc_getitem_bool_diff_lenx  s     999QUQQQQQ]:S111 	 	F5MM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   A**A.1A.c                    t          dddddddddd	d
dg          }t          ddddddddg          }|j        d d         }t          j        ||           t          dddgdg          }|j        ddddf         }t          j        ||           t          dddddddd
dg          }|j        d d d f         }t          j        ||           d S )Nr   r   r;   r   rx   r   r   r   r   r   r   rg   r   )ry   r   c                 
    ddgS )Nr   r   r8   )rS   s    r/   r   zATestiLocBaseIndependent.test_iloc_getitem_slice.<locals>.<lambda>  s
    1v r1   r   r   s       r/   test_iloc_getitem_slicez/TestiLocBaseIndependent.test_iloc_getitem_slice  s7   aa((#..D11
 
 AAA66cRU8V8VWXX!
fh///Cc223A3???1ac"
fh///1Ss334d5K5KL
 
 ---.
fh/////r1   c                    t          t          j                            d                              d          g d          }t          t          j                            d                              ddd                              dd          d	d
g          }t          ||gd          }t          j	        |j
        d d d df         |           t          j	        |j
        d d dd f         |           t          ||gd          }t          j	        |j
        d d d df         |           t          j	        |j
        d d dd f         |           t          ||j
        d d dgf         gd          }t          j	        |j
        d d ddf         |           t          ||gd          }t          j	        |j
        ddd df         |           t          j	        |j
        dddd f         |           t          j	        |j
        dd d df         |           t          j	        |j
        dd dd f         |           d S )Nr   rz   r\   )ry   ry   r   r   rr   r   rz   ro   sizery   r   r   r   r\   r;   )r   rM   r   r   r   integersr   r   rO   rP   r(   )r,   r   r   rS   exps        r/   test_iloc_getitem_slice_dupsz4TestiLocBaseIndependent.test_iloc_getitem_slice_dups  sZ   I!!!$$44W==(((
 
 
 I!!!$$--a"-==EEb!LL#J
 
 
 S#JQ'''
bgaaa!enc222
bgaaaenc222S#JQ'''
bgaaa!enc222
bgaaaenc222c38AAAsF+,1555
bgaaa1fos333 RH1%%%
bgadBQBh/555
bgadABBh/555
bgbcc2A2g.444
bgbcc122g.44444r1   c           	      n   t          t          j                            d                              d          t          j        ddd          t          j        ddd                    }|r
|d d          }d|j        d	<   |j        d	         }|dk    sJ d|j        d d ddf<   |j        d d ddf         }|j        d d ddf         }t          j        ||           t          dg d
          }|j        ddxx         dz  cc<   t          g dg d
          }t          j
        ||           d S )Nr   r\   r\   r         r;   r   r   r   r   r   rg   r   r   r   )r   rM   r   r   r   r   r(   rO   rP   r   r   )r,   warn_copy_on_writerX   rS   rd   r   rU   r   s           r/   test_iloc_setitemz)TestiLocBaseIndependent.test_iloc_setitem  sT    I!!!$$44V<<)Aq!$$IaQ''
 
 

  	aaa5D{{{{1Q37111ac6?AaC
fh/// 1III&&&	qsq)))999555
q(+++++r1   c                    t          g dg dg dg          }|d                             t                    |d<   |r
|d d          }t          g dg dg dg          }|d                             t                    |d<   d|                    d          d	<   t	          j        ||           t          g dg dg dg          }|d                             t                    |d<   |r
|d d          }t          g d
g dg dg          }|d                             t                    |d<   d|                    d          d	<   t	          j        ||           d S )N)r   crz   )r   dr|   )r   er   r   )rp   rp   rp   rp   r   r   r   )r   r   rp   )r   r   rp   )r   r   rp   )r   rL   rF   r(   rO   rP   r,   rX   rS   rd   rU   s        r/   test_iloc_setitem_axis_argumentz7TestiLocBaseIndependent.test_iloc_setitem_axis_argument  sn    lllLLLABB1V$$1 	aaa5DlllLLL)))DEEqk((00Q
b(+++lllLLLABB1V$$1 	aaa5Dkkk;;;DEEqk((00Q
b(+++++r1   c                    t          t          j        d                              d          g dg d          }|r
|d d          }|j        ddgddgf          |j        ddgddgfxx         dz  cc<   t          t          j        g d	                              d          g dg d          }t          j        ||           d S )
N	   r;   r;   r   r   r   r   r   rx   )	r   r   r   r;   r   r   r   r   r   )r   rM   r   r   r(   r   rO   rP   r   s        r/   test_iloc_setitem_listz.TestiLocBaseIndependent.test_iloc_setitem_list  s     IaLL  ((
 
 
  	aaa5D
AA
AA3&H88899AA&II!//#OO
 
 

 	b(+++++r1   c                 Z   t          g d          }t          g d          }|                                }ddg|j        t          ddg          <   t          j        ||           |                                }ddg|j        t          ddg          <   t          j        ||           d S )N)r   r   r   r;   )r   r   r;   r   r   r   r   )r   rJ   r(   rO   r   r	   )r,   s_origrU   r   s       r/   test_iloc_setitem_pandas_objectz7TestiLocBaseIndependent.test_iloc_setitem_pandas_object  s    %%...))KKMM"$bvq!f~~
q(+++KKMM!#RuaV}}
q(+++++r1   c                 F   t          d dddddg          }t          ddddddg          }t          ||gd          }|                    d          }t          j        |j        d d df                   }||         j        }|j        |df         |j        |df<   t          j        ||           t          ddgddgd          }d	d	g|_	        |d
= t          j        ||           |j        ddgddgf         |j        ddgddgf<   t          j        ||           |j        ddgddgf         
                    d          |j        ddgddgf<   |j        ddgddgf         
                    d          |j        ddgddgf<   t          j        ||           d S )Nr   r   r   r;   r\   r   r   rD   r   ry   T)drop)r   r   fillnarM   isnanr(   rh   rO   rP   rs   reset_index)r,   r   r   rS   rU   indsmasks          r/   test_iloc_setitem_dupsz.TestiLocBaseIndependent.test_iloc_setitem_dups  s    t!,,AA.>.>?@@qq))+;+;<==S#JQ'''99Q<<x1&&Dz747+a
b(+++ !QQF3344:sG
b(+++ #%'1a&1a&."9AA
b(+++ #%'1a&1a&."9"E"E4"E"P"PAA"$'1a&1a&."9"E"E4"E"P"PAA
b(+++++r1   c                 V   t          ddgddggddg          }|j        d d df                             d          |j        d d df<   |st          |j        j                  dk    sJ t          j        t          d	          5  |j        d d df         d
z   |j        d d df<   d d d            n# 1 swxY w Y   |st          |j        j                  dk    sJ |	                                }|j        ddgddgf         |j        ddgddgf<   t          j
        ||           d S )Nr   r   r   r;   r   rr   f8incompatible dtypert   g      ?)r   r(   rL   r   rG   rH   rO   assert_produces_warningFutureWarningrJ   rP   )r,   rQ   rS   rU   s       r/   9test_iloc_setitem_frame_duplicate_columns_multiple_blockszQTestiLocBaseIndependent.test_iloc_setitem_frame_duplicate_columns_multiple_blocks   s   
 AA'#s<<< 1,,T221" 	,rw~&&!++++ '=QRRR 	0 	0GAAAqDMC/BGAAAqDM	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0" 	,rw~&&!++++7799 #%'1a&1a&."9AA
b(+++++s   !B33B7:B7c           	         t          t          j                            d                              d          t          ddd          t          ddd                    }|j        d         }|j        d         }t          j	        ||           |j        d         }|j        d	         }||k    sJ |j        dd         }|j        dd
         }t          j
        ||           |j        d d ddf         }|j        d d ddf         }t          j
        ||           |j        g d         }|j        g d         }t          j
        ||           |j        g dddgf         }|j        g dddgf         }t          j
        ||           |j        g dddgf         }|j        g dddgf         }t          j
        ||           |j        g dddgf         }|j        g dddgf         }t          j
        ||           t          t          dd          t                    }|j        |j                 }|j        g d         }t          j
        ||           d S )Nr   r   r   ro   r   r   r\   )r   r   r      r;   rp   )r   r   r;   )r   r   r   r   )r   r   r;   r   )r}   r   r   r   )r   r   r   r;   )r}   r}   r   r   )rh   r?   )r   r\   r   r   )r   rM   r   r   r   rE   r(   locrO   r   rP   r   rF   rh   )r,   rS   r   r   rU   r   s         r/   test_iloc_getitem_framez/TestiLocBaseIndependent.test_iloc_getitem_frame=  sn   I!!!$$44W==2q//!QNN
 
 
 fQi
vs+++fTl}}}} 16!B$<
fh///AaC6!!!QqS&>
fh/// #6)))$
fh///QF*+6)))aV+,
fh/// b!W,-6***q!f,-
fh/// "a016...1a&01
fh/// q!F333!6,,,'
fh/////r1   c                    t          t          j                            d                              d          t          d          t          d                    }|j        d         }|j        d         }||k    sJ |j        d d ddf         }|j        d d d	gf         }t          j	        ||           |j        d
         }|j        d         }||k    sJ d}t          j        t          |          5  |j        d          d d d            n# 1 swxY w Y   d}t          j        t          |          5  |j        d          d d d            d S # 1 swxY w Y   d S )Nr   r   
abcdefghijABCDr   r   )br   r;   r   )r   r   )jr   zCindex 5 is out of bounds for axis 0 with size 4|index out of boundsrt   )rz   rp   zLocation based indexing can only have \[integer, integer slice \(START point is INCLUDED, END point is EXCLUDED\), listlike of integers, boolean array\] types)r   rM   r   r   r   r   r(   r   rO   rP   r5   r   r+   
ValueError)r,   rS   r   r   rU   r   s         r/    test_iloc_getitem_labelled_framez8TestiLocBaseIndependent.test_iloc_getitem_labelled_framen  s   I!!!$$44W==|$$LL
 
 
 fX}}}}AaC6!!!cU(#
fh/// fX}}}} T]:S111 	 	GENN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	
; 	
 ]:S111 	 	GH	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s$   8DDD:EEEc                 ^   t           j                            d                              d          }t	          dd          }t          d          }t          |||          }|                                 |j        dd	d
df         }t          |dd	d
df         |dd	         |d
d                   }t          j
        ||           t          d          |_        |j        dd	d
df         }t          |dd	d
df         |dd	         t          d                    }t          j
        ||           t           j                            d                              d          }t          t          d
dd                    }t          t          d
dd                    }t          |||          }|s|j        j        d
         j         |j        dd	ddf         }t          |dd	ddf         |dd	         |dd                   }t          j
        ||           d S )Nr   )r   r\   20130101r   )periodsr  r   r;   rp   r   aaaaaar   r   r   r\   )rM   r   r   r   r   r   r   describer(   rO   rP   rs   rE   rG   rH   mgr_locs)r,   rQ   rc   rh   rs   rS   r   rU   s           r/   test_iloc_getitem_doc_issuez3TestiLocBaseIndependent.test_iloc_getitem_doc_issue  s    i##A&&66v>>:q111v,,s%999 	1ac"S1ac]%!*gaPQclSSS
fh/// &\\
1ac"S1ac]%!*d4jjQQQ
fh/// i##A&&66v>>U1b!__%%uQ1~~&&s%999" 	'GN1&&1ac"S1ac]%!*gaPQclSSS
fh/////r1   c                    t          t          j                            d                              d          t          d          t          d                    }|r
|d d          }d|j        d<   |j        d         }|dk    sJ d|j        d d dd	f<   |j        d d dd	f         }|j        d d dd	f         }t          j        ||           t          t          j                            d                              d
          t          ddd                    }d|j        d<   |j        d         }|dk    sJ d|j        d d<   |j        d d         }|j        d d         }t          j        ||           t          dgdz            }g d|j        dd d<   g d|j        dd d<   |}t          g d          }t          j        ||           d S )Nr   r   r  r  r   r   r   r   r;   rz   ro   rg   r\   r   r   )r   r   r\   )r   r;   rp   rv   )r   rM   r   r   r   r   r(   rO   rP   r   rE   r   )r,   rX   rS   rd   r   rU   r   s          r/   test_iloc_setitem_seriesz0TestiLocBaseIndependent.test_iloc_setitem_series  s    I!!!$$44W==|$$LL
 
 

  	aaa5D{{{{1Q37111ac6?AaC
fh///29((++;;B??uQPRTUWWWq	{{{{rr
6"1":
vx000B4!8 yyqt!t yyqt!t,,,--
vx00000r1   c                    t          t          j        dd          t          j        ddd          d          }|r
|d d          }ddgddgg|j        d	d
<   t          g dg dd          }t	          j        ||           t          g dt          j        ddd          d          }|r
|d d          }ddgddgg|j        d	d
<   t          g dg dd          }t	          j        ||           d S )Nrp   int64r>   rz   r   r|   r   r   r   r\   )r   r   rz   r   r\   )rp   r   r|   r   r   r   r  r   r   r   r   y)r   r  r   r  r   )r   rM   r   r(   rO   rP   r   s        r/   test_iloc_setitem_list_of_listsz7TestiLocBaseIndependent.test_iloc_setitem_list_of_lists  sG   
 )AW---BIa74S4S4STT
 
  	aaa5DR2r(+!#4#4#4;L;L;LMMNN
b(++++++")Ar2Q2Q2QRR
 
  	aaa5Db	C9-!#<#<#<CTCTCTUUVV
b(+++++r1   r   valueZc                     t          ddgddggddg                              dt          i          }|r
|d d          }||j        d|f<   |j        d	         }t	          |          r|d
k    sJ d S )Nr   r   r;   r\   ry   r   rr   r   rC   r  )r   rL   rF   r(   r   )r,   rX   r<   r  rS   rd   r   s          r/   #test_iloc_setitem_with_scalar_indexz;TestiLocBaseIndependent.test_iloc_setitem_with_scalar_index  s     AA'#s<<<CCS&MRR 	aaa5D#7
  2Vs]]]]]]r1   zignore::UserWarningc                 0   t          t          t          d                    t          d          dg          }|j        dz  dk    }d}t	          j        t          |          5  |j        |          d d d            n# 1 swxY w Y   t          t          |                    |_	        d	}t	          j        t          |          5  |j        |          d d d            n# 1 swxY w Y   |j        t          j        d
gt          |          z  t                             }t          j        ||           t          j        d          }d|z  }d |D             }t          ||d|          }ddddddddd	d	}dD ]}	|j        dk    j        }|	r6t'          ||	          d d d         }
t)          |t          |
                    }dD ]}	 |rt'          ||dd                    }n|}t+          t-          ||         d                                                             }n3# t          t0          t          f$ r}t+          |          }Y d }~nd }~ww xY w|	|f}|                    |          }||k    rt5          d| d| d| d          ǐd S )Nrp   rq   r   r   r   r   zBiLocation based boolean indexing cannot use an indexable as a maskrt   zDiLocation based boolean indexing on an integer type is not availableTr>   r\   c                 ,    g | ]}t          |          S r8   )bin).0nums     r/   
<listcomp>z:TestiLocBaseIndependent.test_iloc_mask.<locals>.<listcomp>  s    )))SC)))r1   )locsnums0b11000b11ztUnalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match).)	)N )N.loc)N.iloc)rh   r$  )rh   r%  )rh   r&  )r   r$  )r   r%  )r   r&  )Nrh   r   r   )r$  r%  r&  r   r!  [z] does not match [z], received [])r   r   rE   r   r5   r   r  r(   r   rh   NotImplementedErrorrM   r   boolrO   rP   r   r!  rK   getattrr   strr  sumr   getAssertionError)r,   rS   r   r   r   r   r!  repsrU   idx
mask_indexmethodaccessoranswererrr   rs                    r/   test_iloc_maskz&TestiLocBaseIndependent.test_iloc_mask  s\    tE!HH~~T']]SEJJJtax1}R]:S111 	 	GDMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	3t99%%
T].c::: 	 	GDMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 4&3t99"4DAAAB
fb))) y||$w))D)))d33T:: !$%!%T$,0!
 
, + 	 	CGaK'D 6$R--ddd3
dD$4$455/  & &#*2vabbz#:#:#% Xd^F%;%?%?%A%A!B!BCCFF"M3FG & & & XXFFFFFF&  LL%%;;(LCLL6LLLLL   	 	s=   &B  BB	C##C'*C'AH((I?IIc                    t          dgdz  dgdz  d          }t          j        d          dz  }|j        |         }t	          |d|z  d|z  g          }|j        |         }t          j        ||           t          dgd	z  dgd	z  d          }t	          |d|z  d|z  g          }t          j        t          d
          5  |j
        |          d d d            d S # 1 swxY w Y   d S )N皙?r   r   r   rw   c   r   r;   r   znot in indexrt   )r   rM   r   r(   r   rO   rP   r5   r   KeyErrorr   )r,   rS   r1  rU   df3r   r   s          r/   test_iloc_non_unique_indexingz5TestiLocBaseIndependent.test_iloc_non_unique_indexingJ  s;   cUT\d
;;<<immb 73<b!b&!b&)**#
fh///sedl!t<<==c1s7AG,--]8>::: 	 	GCLL	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   C!!C%(C%c           
      .   t          t          j        d          t          d t	          d          D             d          t          d t	          d          D             d                    }t          j        |j        d d g f         |j        d d d d	f         d
d
           t          j        |j        g d d f         |j        d d	d d f         d
d
           t          j        |j        g          |j        d d	d d f         d
d
           d S )Nr~   c                     g | ]}d | S zi-r8   r  is     r/   r  zNTestiLocBaseIndependent.test_iloc_empty_list_indexer_is_ok.<locals>.<listcomp>^  s    444aa444r1   rp   r   r   c                     g | ]}d | S rA  r8   rB  s     r/   r  zNTestiLocBaseIndependent.test_iloc_empty_list_indexer_is_ok.<locals>.<listcomp>_  s    666888666r1   r   r   r   T)check_index_typecheck_column_type)r   rM   onesr	   rE   rO   rP   r(   r,   rS   s     r/   "test_iloc_empty_list_indexer_is_okz:TestiLocBaseIndependent.test_iloc_empty_list_indexer_is_ok[  sC   GFOO445884443???66U1XX666SAAA
 
 
 	GAAArENGAAArrEN!"		
 	
 	
 	
 	GBENGBQBEN!"		
 	
 	
 	
 	GBK!QQQ$RV	
 	
 	
 	
 	
 	
r1   c                    t          dg di          }|j        d d          }||usJ t          j        |d         |d                   sJ t	          j        |          5  g d|j        d d df<   d d d            n# 1 swxY w Y   |r#|d         g dk                                    sJ n |d         dk                                    sJ t          g d          }|j        d d          }||usJ t	          j        |          5  g d|d d<   d d d            n# 1 swxY w Y   |r!t          |d d         g dk              sJ d S t          |d d         g dk              sJ d S )Nr   r   )r\   r\   r\   r\   )r   r   r;   r\   rp   r   r   r   r   r;   )	r   r(   rM   rN   rO   assert_cow_warningr   allr   )r,   rb   r   original_df	sliced_dforiginal_seriessliced_seriess          r/   &test_identity_slice_returns_new_objectz>TestiLocBaseIndependent.test_identity_slice_returns_new_objectt  sC     iii 011$QQQ'	++++ C 0)C.AAAAA "#566 	0 	0&/iiKOAAAsF#	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	/cNiii/44666666cNa',,..... !3!3!344',QQQ/O3333 "#566 	, 	,"+))OBQB	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	7}RaR(III56666666}RaR(III56666666s$    A==BB
DD!$D!c                     t          ddgddgg          }|j        t          j        d                   }t	          ddgd          }t          j        ||           d S )Nr   r   r;   r\   r   rD  )r   r(   rM   r   r   rO   r   )r,   rS   r   r   s       r/   test_indexing_zerodim_np_arrayz6TestiLocBaseIndependent.test_indexing_zerodim_np_array  s_    AA'((!%Aq6"""
vq)))))r1   c                 v    t          ddg          }|j        t          j        d                   }|dk    sJ d S )Nr   r   r   )r   r(   rM   r   )r,   r   r   s      r/   %test_series_indexing_zerodim_np_arrayz=TestiLocBaseIndependent.test_series_indexing_zerodim_np_array  s6    Aq6NN${{{{{{r1   c                 J   t          g d          }t          |g ddd          }t          j        |d         |          sJ |d d d         |j        d d df<   t          j        |d         |          sJ t          g d	g d
          }t          j        ||           d S )Nr   r   )r   r   F)rJ   r   r   r   )r   r   ry   
categories)r   r   rO   rN   r(   assert_categorical_equal)r,   rR   rS   rU   s       r/   -test_iloc_setitem_categorical_updates_inplacezETestiLocBaseIndependent.test_iloc_setitem_categorical_updates_inplace  s    ///**3999--E:::1s+++++ DDbD	11s+++++???KKK
#C22222r1   c                    t          ddgddgddgdt          j        gg          }|j        |j        dk    xx         dz  cc<   t          ddgddgdd	gdt          j        gg          }t          j        ||           |j        |j        dk    xx         dz  cc<   t          ddgddgdd	gd
t          j        gg          }t          j        ||           |j        g dxx         dz  cc<   t          ddgdd
gdd	gd
t          j        gg          }t          j        ||           |j        g dxx         dz  cc<   t          ddgddgddgdt          j        gg          }t          j        ||           d S )Nr   r   r   r;   r\   rp   r   r   rz   r   )TTFF)FFTTg      @g      (@g      @)r   rM   r   r(   rh   rO   rP   r,   r   rU   s      r/    test_iloc_with_boolean_operationz8TestiLocBaseIndependent.test_iloc_with_boolean_operation  s   QFQFQFQK@AAFLA%&&&!+&&&q!fq!fq"g26{CDD
fh///FL1$%%%*%%%q!fq!fq"gBF|DEE
fh///...///14///q!fq"g2wRVEFF
fh///...///14///q#hD	As8a[IJJ
fh/////r1   c                     t          dt          d                                          i          }|j        d         }t          dgg d          }t	          |dgdd          }t          j        ||           d S )	Nr   z	a b c d er   r   r  rY  category)rh   r   r?   )r   r   splitr(   r   rO   r   )r,   rS   r   raw_catrU   s        r/   ?test_iloc_getitem_singlerow_slice_categoricaldtype_gives_serieszWTestiLocBaseIndependent.test_iloc_getitem_singlerow_slice_categoricaldtype_gives_series  s    [):):)<)<==>??se0I0I0IJJJ'#QjIII
vx00000r1   c                 V   t          g d                              d          }|j        dd         }t          ddg                              t          g d                    }t	          j        ||           |j        ddg         }t          ddg                              t          g d                    }t	          j        ||           |j        g d         }t          dg                              t          g d                    }t	          j        ||           d S )Nr   ra  r   r   r   TFF)r   rL   r(   r   rO   r   )r,   rl   r   rU   s       r/   $test_iloc_getitem_categorical_valuesz<TestiLocBaseIndependent.test_iloc_getitem_categorical_values  s    YYY&&z22 !A#1a&>>(()9))))D)DEE
vx000 1a&!1a&>>(()9))))D)DEE
vx000 .../1#;;%%&6yyy&A&ABB
vx00000r1   c                     t          g dd          }||j        d<   t          t          ddgd          }t          j        ||           d S )Nr   ztimedelta64[ns]r>   r   r   r   )r   r(   r   rO   r   )r,   r  r   rU   s       r/   %test_iloc_setitem_td64_values_cast_naz=TestiLocBaseIndependent.test_iloc_setitem_td64_values_cast_na  sX     			):;;;A31+->???
vx00000r1   not_nar   g      ?c                     t          |g          }t          ||||g|          }|||g|j        d d<   t          ||||g|          }t          j        ||           d S )NrY  r>   r;   )r   r   r(   rO   r   )r,   rj  nulls_fixturer?   rl   r   s         r/   $test_setitem_mix_of_nan_and_intervalz<TestiLocBaseIndependent.test_setitem_mix_of_nan_and_interval  s     !VH555M=-HPU
 
 
 &v}=!mV]MJRWXXX
sC(((((r1   c                    t          g           }t          t          j                            d                              t          |          t          |          f          ||          }t          j                            d                              dd          }d|j         }t          j
        t          |          5  d|j        |<   d d d            d S # 1 swxY w Y   d S )	Nr   r   rp   )r   r   r   r   zCannot set values with ndim > rt   r   )r	   r   rM   r   r   r   r   r   ndimr5   r   r  r(   )r,   r1  r.   nd3r   s        r/   4test_iloc_setitem_empty_frame_raises_with_3d_ndarrayzLTestiLocBaseIndependent.test_iloc_setitem_empty_frame_raises_with_3d_ndarray  s   BiiI!!!$$44c#hhC5IJJ
 
 

 i##A&&//	/BB9sx99]:S111 	 	CHSM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   CC#&C#c                 j   t          j        d          }t          |          }t          j        d          }|                    d           t          |          }t	          j         ||          g d          ||          g d                    t	          j         ||          dg          ||          dg                    t	          j         ||          d          ||          d                    t	          j         ||          dd          ||          dd                    d S )Nrz   F)writer   r   r;   )rM   eyer   setflagsrO   rP   r   )r,   r<   rw_arrayrw_dfro_arrayro_dfs         r/   "test_iloc_getitem_read_only_valuesz:TestiLocBaseIndependent.test_iloc_getitem_read_only_values  s    6"::(##6"::&&&(##
ggennYYY7			9RSSS
ggennaS1775>>1#3FGGG
wwu~~a0''%..2CDDD
ggennQqS1775>>!A#3FGGGGGr1   c                 p   t          dt          j        dd          i          }t          j        g d          }d|j        _        |j        |         }|j        g d         }t          j	        ||           |d         j        |         }|d         j        g d         }t          j
        ||           d S )Ndatarx   float64r>   )r   r;   r   F)r   rM   rH  r   flags	writeabler(   r   rO   rP   r   )r,   rS   indicesr   rU   s        r/   test_iloc_getitem_readonly_keyz6TestiLocBaseIndependent.test_iloc_getitem_readonly_key  s    9 = = =>??(999%%"'!6)))$
fh///F)f:>))),
vx00000r1   c                     t          dgdg          }t          g d          |j        d<   t          dt          g d          gidgdg          }t          j        ||           d S )Nr   r   rs   rh   r   rC   )r   r   r(   rO   rP   r,   rS   rU   s      r/   "test_iloc_assign_series_to_df_cellz:TestiLocBaseIndependent.test_iloc_assign_series_to_df_cell   st    uQC000yyy))cF999$5$5#67#qcRRR
b(+++++r1   klassc                     t          g dg dd          } |g d          }|j        |df         dz  |j        |df<   t          g dg dd          }t          j        ||           d S )N)r   r  z)r   r;   r\   )flagr  rf  r   r   )r   r;   r\   r   )r,   r  rS   r<   rU   s        r/   test_iloc_setitem_bool_indexerz6TestiLocBaseIndependent.test_iloc_setitem_bool_indexer'  s     )))DDEE%,,,-- ggqj1A5
ooo			JJKK
b(+++++r1   r   c                    t          g dg dd          }t          g dg dg dd          }|r
|d d          }|j        d d dgf         |j        d d |f<   t          g dg dg dd          }t          j        ||           d S )	N)r|   r   r   )r         )a2b2r   r   rL  r   r  r   r   r   )r,   r<   rX   r   r   rd   rU   s          r/   %test_iloc_setitem_pure_position_basedz=TestiLocBaseIndependent.test_iloc_setitem_pure_position_based0  s    
 |||<<<@@AAiiiiiiiiiHHII 	qqq6D"xA3/G999<<<iiiPPQQ
c8,,,,,r1   c                 l   t          ddgddgd          }|r
|d d          }ddd}||j        d<   t          ddgddgd          }t          j        ||           t          ddgddgd          }|r
|d d          }||j        d<   t          ddgddgd          }t          j        ||           d S )Nr   r   )r   r  r   r;  g       @g     X@r   )r,   rX   rS   rd   rhsrU   s         r/   "test_iloc_setitem_dictionary_valuez:TestiLocBaseIndependent.test_iloc_setitem_dictionary_value=  s     aV1a&1122 	aaa5DB
Aq6B8899
b(+++ aV3*5566 	aaa5D
Aq6d<<==
b(+++++r1   c                 n   t          t          j                            d                              d          g dt          d                    }|j        dd          }t          j        |j	        d         |           |j        dd df         }t          j
        |j	        d	         |           g d
|_        |j        dd          }t          j        |j	        d         |           |j        dd df         }t          j
        |j	        d	         |           t          t          j                            d                              d          g dt          d                    }|j        dd         }t          j        |j	        d         |           |j        dddf         }t          j
        |j	        d	         |           g d|_        |j        ddg         }t          j        |j	        d         |           |j        ddgdf         }t          j
        |j	        d	         |           d S )Nr   r   )r:  皙?r  abcr   r   r  r   )r  r   )r   r  r  )r\   r;   )r   r  r  r   r   )r:  r  r   r  )r   rM   r   r   r   r   r(   rO   rP   r   r   rh   )r,   rS   expects      r/   "test_iloc_getitem_float_duplicatesz:TestiLocBaseIndependent.test_iloc_getitem_float_duplicatesQ  s   I!!!$$44V<<!//KK
 
 

 
bfSk6222Q
rvh/888 ==
bfSk6222Q
rvh/888I!!!$$44V<<"""KK
 
 

 2
bfSk62222q!
rvh/888%%%!R!
bfSk6222!R!$
rvh/88888r1   c                     G d d          }t          ddgdg          } |d          |j        d<    |d          |j        d<   t          ddgdg          } |d          |j        d<   t          j        ||           t          ddgdg          } |d          |j        d<   t          j        |j        d<   t          ddgdg          }t          j        ||           d S )Nc                   8    e Zd ZddZdefdZeZdefdZd Z	dS )CTestiLocBaseIndependent.test_iloc_setitem_custom_object.<locals>.TOreturnNc                     || _         d S Nr  )r,   r  s     r/   __init__zLTestiLocBaseIndependent.test_iloc_setitem_custom_object.<locals>.TO.__init__y  s    "


r1   c                     d| j          dS )Nr'  r(  r  r,   s    r/   __str__zKTestiLocBaseIndependent.test_iloc_setitem_custom_object.<locals>.TO.__str__|  s    (4:((((r1   c                 "    | j         |j         k    S r  r  )r,   others     r/   __eq__zJTestiLocBaseIndependent.test_iloc_setitem_custom_object.<locals>.TO.__eq__  s    zU[00r1   c                     | S r  r8   r  s    r/   rd   zHTestiLocBaseIndependent.test_iloc_setitem_custom_object.<locals>.TO.view  s    r1   )r  N)
r2   r3   r4   r  r,  r  __repr__r*  r  rd   r8   r1   r/   TOr  x  st        # # # #) ) ) ) ) H1t 1 1 1 1    r1   r  r   r   r   ri   r   )r   r(   rO   rP   rM   r   )r,   r  rS   r   s       r/   test_iloc_setitem_custom_objectz7TestiLocBaseIndependent.test_iloc_setitem_custom_objectv  s   	 	 	 	 	 	 	 	 aVaS11111!Q!555BqEED
fb))) aVaS1111!Q!555
fb)))))r1   c                    t          t          j                            d                              d          t	          d          t	          d                    }|j        d         }t          |t                    sJ t          j	        |j
        |j
        d                    |j        j        d d df         }t          |t                    sJ t          j	        |j
        |j
        d                    d S )Nr   r   ABCaabr  r   )r   rM   r   r   r   r(   
isinstancer   rO   assert_almost_equalrK   T)r,   rS   r   s      r/   !test_iloc_getitem_with_duplicatesz9TestiLocBaseIndependent.test_iloc_getitem_with_duplicates  s    I!!!$$++F33KKu++
 
 
 &&)))))
v}bil;;;111a4&&)))))
v}bil;;;;;r1   c                     t          g dg dgg d          }|j        d d dgf         }|                    dgd          }t          j        ||           d S )Nr   r   )r   r   r   rr   r   r   r   )r   r(   takerO   rP   r,   rS   r   rU   s       r/   "test_iloc_getitem_with_duplicates2z:TestiLocBaseIndependent.test_iloc_getitem_with_duplicates2  sj    			999-yyyAAAQC77A3Q7''
fh/////r1   c                 "   t          t          dd          ddgi          }|j        d         }t          t          dd          did          }t	          j        ||           |j        d d df         }t          ddgt          dd                    }t	          j        ||           |                                }|j        d d dfxx         dz  cc<   t          t          dd          ddgi          }t	          j        ||           d S )Nr   r   r   rD  r;   )r   r
   r(   r   rO   r   rJ   rP   r  s       r/   test_iloc_intervalz*TestiLocBaseIndependent.test_iloc_interval  s   AA/008Aq>>1-A666
vx000A1a&x1~~666
vx000AAAqDQhq!nnq!f566
fh/////r1   indexing_funcrhs_funcc                 n   t          g d          } |ddg          |j         |g d          <   t          g d          }t          j        ||           t	          dg di          } |dgdgg          |j         |g d          <   t	          dg di          }t          j        ||           d S )Nr   rp   rz   TFT)rp   r   rz   r   )r   r(   rO   r   r   rP   )r,   r  r  rl   rU   rS   s         r/   test_loc_setitem_boolean_listz5TestiLocBaseIndependent.test_loc_setitem_boolean_list  s     YYY7?xB7H7H222334***%%
sH---YYY'((6>hbT{6K6K111223c:::.//
b(+++++r1   c                    t          dg did          }|j        d d d d df         }t          j        ||           d|d<   |j        d d d d df         }t          |d         |d         d          }t          j        ||           d S )	Nry   r   Int64r>   r   foor   )r   ry   r   )r,   rS   resrU   s       r/   .test_iloc_getitem_slice_negative_step_ea_blockzFTestiLocBaseIndependent.test_iloc_getitem_slice_negative_step_ea_block  s    YYY'w777gaaa2g
c2&&&3gaaa2g2c7C99::
c8,,,,,r1   c                 ,   t          dg did          }t          j        dgdgg          |j        t          j        ddg          t          j        dg          f<   t          dg di|d         j                  }t          j        ||           d S )	Nstatusr  ra  r>   r   r   r   )r   r   r   )r   rM   r   r(   r?   rO   rP   r  s      r/   *test_iloc_setitem_2d_ndarray_into_ea_blockzBTestiLocBaseIndependent.test_iloc_setitem_2d_ndarray_into_ea_block  s    ///2*EEE358cUSEN3K3K!Q  "(A3--/0h88@RSSS
b(+++++r1   c                     t          dd          j        }t          |          }|j        d         }|d         |d         k    sJ |d         |d<   |d         |d         k    sJ d S )Nr   g      $@r   r   r   )r   _valuesr   r(   )r,   rc   rS   rl   s       r/   *test_iloc_getitem_int_single_ea_block_viewzBTestiLocBaseIndependent.test_iloc_getitem_int_single_ea_block_view  su     Q%%-s^^ gaj 1vR    RA1vR      r1   c                    t          ddgddgd          }|rct          j        t          d          5  t          dt	          ddg          i          |j        d d d	gf<   d d d            d S # 1 swxY w Y   d S t          dt	          ddg          i          |j        d d d	gf<   t          t          d
          t          d          gddgd          }t          j        ||d           d S )Nz
2022-01-01z
2022-01-0220212022r   z%Setting an item of incompatible dtypert   ry   r   z2021-01-01 00:00:00z2022-01-01 00:00:00F)check_dtype)r   rO   r   r   r   r(   r   rP   )r,   using_infer_stringrS   rU   s       r/   )test_iloc_setitem_multicolumn_to_datetimezATestiLocBaseIndependent.test_iloc_setitem_multicolumn_to_datetime  s   lL9@PQQRR 	C+%L   R R #,S+vv>N2O2O,P"Q"QA3R R R R R R R R R R R R R R R R R R
 (k66:J.K.K(LMMBGAAAsFO  ""788!"788 !&)  H !"hEBBBBBBs   .A//A36A3)Qr2   r3   r4   __doc__r5   r6   r7   slicerE   r	   rM   asarrayrO   r   r(   rV   filterwarningsr   r   re   rm   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r8  r>  rJ  rS  rU  rW  r\  r_  rd  rg  r   r   ri  r
   rm  rq  rz  r  r  r  r  r  r  r  r  r  r  r  r  r  td&skip_array_manager_not_yet_implementedr  r  r8   r1   r/   r:   r:   <   s	       ))[E$KKE!HHE!HHIIE%%((OOBJyyy!!	

 
 [Y(9::, , ;:
 
,@ [ PQQ[Yu66[UUFO44 ?  ? 54 76 RQ ?D1 1 1c c cJ [_		"ttG}}/M.NOO[ eDkkC:&3Zt%htQ""#UU4[[1	
 	- 	-  PO	-  H H H1 1 161 1 10 0 0&0 0 0& [We}6P6P6P&QRR  SR0 0 0.5 5 5: [ PQQ[Yu66, , 76 RQ,0 [ PQQ[Yu66, , 76 RQ,( [ PQQ[Yu66, , 76 RQ,", , ,, , ,8, , ,:/0 /0 /0b! ! !F"0 "0 "0H [ PQQ[Yu66"1 "1 76 RQ"1H [ PQQ[Yu66, , 76 RQ,* [ PQQ[Yu66[Y!eeD!T.B.BHBHaSMM(RSS[Wuhbhuoo&>??3 3 @? TS 76 RQ3 [ 566C C 76CJ  "
 
 
27 7 7B* * *  3 3 30 0 0&1 1 11 1 1* [WtS"&&9::1 1 ;:1 [XAS'ABB) ) CB)   [Y(9::H H ;:H1 1 1, , , [WtRX&677, , 87, [ PQQ[Yu66[Y!eeAqkk(:;;- - <; 76 RQ- [ PQQ[Yu66, , 76 RQ,$#9 #9 #9J *  *  *D< < <0 0 00 0 0" [_tRX.>??[Z$)9::
, 
, ;: @?
,
- 
- 
-, , , .! ! /.!C C C C Cr1   r:   c                       e Zd Zd Zej                            d          ej                            dddg          d                         Zd Z	dS )	TestILocErrorsc                    |}|t           u r|                                }d}t          j        t          |          5  |j        d          d d d            n# 1 swxY w Y   t          j        t          t                    5  t          j	        |o|t           u           5  d|j        d<   d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nz5Cannot index by location index with a non-integer keyrt   g      @r   )
r   rk   r5   r   r   r(   r+   _slice_iloc_msgrO   rM  )r,   series_with_simple_indexra   r   r.   r   s         r/   test_iloc_float_raisesz%TestILocErrors.test_iloc_float_raises
  s    'i'',,..CE]9C000 	 	HSMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ]:_=== 	" 	"&"C)'C  " " !"" " " " " " " " " " " " " " "	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	"sG   AAAC B7+C7B;	;C>B;	?CCCrW   rX   TFc                 >   t          j        t          d          5  |j        d d d d d d f          d d d            n# 1 swxY w Y   |r
|d d          }t          j        t          d          5  d|j        d d d d d d f<   d d d            d S # 1 swxY w Y   d S )NzToo many indexersrt   ztoo many indices for arrayr   )r5   r   r   r(   r+   )r,   float_framerX   rd   s       r/   *test_iloc_getitem_setitem_fancy_exceptionsz9TestILocErrors.test_iloc_getitem_setitem_fancy_exceptions"  s?    ]=0CDDD 	& 	&QQQ111W%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&  	"qqq>D]:-IJJJ 	* 	*()KQQQ111W%	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*s!   ?AA1BBBc                 V   t          dg di          }t          dg di          }d}t          j        t          |          5  d|j        |<   d d d            n# 1 swxY w Y   d}t          j        t
          |          5  |j        |          d d d            d S # 1 swxY w Y   d S )Nr   r   r  zADataFrame indexer for .iloc is not supported. Consider using .locrt   r   zWDataFrame indexer is not allowed for .iloc
Consider using .loc for automatic alignment.)r   r5   r   r   r(   r+   )r,   rS   r<   r   s       r/   test_iloc_frame_indexerz&TestILocErrors.test_iloc_frame_indexer.  s>   YYY'((S"5"5"5677Q]9C000 	! 	! BGG	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!; 	 ]:S111 	 	GG	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s$   AA"ABB"%B"N)
r2   r3   r4   r  r5   r6   r  r7   r  r  r8   r1   r/   r  r    s        " " "0 [ PQQ[Yu66* * 76 RQ*    r1   r  c                   p    e Zd Zd Zd Zd Zej                            g dddg          d             Z	dS )	TestILocSetItemDuplicateColumnsc                 ,   t          d dddddg          }t          ddddddg          }t          ||gd          }d|j        d<   |j        d         dk    sJ |j        d	         dk    sJ |j        j        d         t          j        k    sJ d S )
Nr   r   r   r;   r\   r   r   rC   )r   r   )r   r   r(   dtypesrM   r  )r,   r   r   rS   s       r/   *test_iloc_setitem_scalar_duplicate_columnszJTestILocSetItemDuplicateColumns.test_iloc_setitem_scalar_duplicate_columns?  s    t!,,AA.>.>?@@qq))+;+;<==S#JQ'''wt}""""wt}!!!!y~a BH,,,,,,r1   c                     t          g dgg d          }dg|j        d d df<   t          g dgg d          }t          j        ||           d S )N)r   r,  str2r   r  r  rr   str3r   )r   r,  r  r   r  s      r/   (test_iloc_setitem_list_duplicate_columnszHTestILocSetItemDuplicateColumns.test_iloc_setitem_list_duplicate_columnsJ  sp    ***+___EEE10001???KKK
b(+++++r1   c                 H   t          t          j        dt          j                                      dd          g d          }|j        d d df                             t          j                  |j        d d df<   |j        j        d         t          j        k    sJ d S )Nr   r>   r   r\   r   rr   r   )	r   rM   r   r  r   r(   rL   r}  r  rI  s     r/   *test_iloc_setitem_series_duplicate_columnszJTestILocSetItemDuplicateColumns.test_iloc_setitem_series_duplicate_columnsS  s    Iarx(((00A66@T@T@T
 
 
 1,,RZ881y~a BH,,,,,,r1   )r  
init_valueexpected_value)r  0r   )floatz1.2g333333?c                    t          |ddggg dt                    }|j        d d df                             |          |j        d d df<   t          |ddggg dt                    }t	          j        ||           d S )Nr,  r  r  )rs   r?   r   )r   rF   r(   rL   rO   rP   )r,   r  r  r  rS   expected_dfs         r/   *test_iloc_setitem_dtypes_duplicate_columnszJTestILocSetItemDuplicateColumns.test_iloc_setitem_dtypes_duplicate_columnsZ  s     %()???&
 
 
 1,,V441eV,-#OO
 
 

 	b+.....r1   N)
r2   r3   r4   r  r  r  r5   r6   r7   r  r8   r1   r/   r  r  >  s        	- 	- 	-, , ,- - - [222	12 / /	 / / /r1   r  c                       e Zd Zd Zd ZdS )TestILocCallablec                    t          g dt          d          dt          d                    }|j        d          }t          j        ||j        ddg                    |j        d	 d d f         }t          j        ||j        ddgd d f                    |j        d
 d f         }t          j        ||j        ddgdf                    |j        d d f         }t          j        ||j        ddgdgf                    |j        ddgd f         }t          j        ||j        ddgdf                    |j        ddgd f         }t          j        ||j        ddgdgf                    |j        d df         }t          j        ||j        ddgdf                    |j        d dgf         }t          j        ||j        ddgdgf                    d S )Nr[   aabbXYr  rg   c                 
    ddgS Nr   r;   r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>x  
    A r1   r   r;   c                 
    ddgS r  r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>{  r  r1   c                 
    ddgS r  r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>~  r  r1   c                     dS Nr   r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>~  s    ! r1   r   c                 
    ddgS r  r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>  r  r1   c                     dgS r   r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>  s    1# r1   c                     dS r   r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>  s     r1   c                     dgS r   r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>  s     r1   c                 
    ddgS r  r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>  r  r1   c                 
    ddgS r  r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>  r  r1   )r   r   r(   rO   rP   r   )r,   rS   r  s      r/    test_frame_iloc_getitem_callablez1TestILocCallable.test_frame_iloc_getitem_callables  s   \\\V==T&\\RRR g&&'
c27Aq6?333g&&)*
c27Aq61119#5666g&&34
sBGQFAI$6777g&&56
c27Aq6A3;#7888 gq!fkk)*
sBGQFAI$6777gq!fmm+,
c27Aq6A3;#7888g&&)*
sBGQFAI$6777g&&+,
c27Aq6A3;#788888r1   c                 *   t          g dt          t          d          t                    dt          d                    }|                                }d|j        d <   |                                }d|j        d	d
g<   t          j        ||           |                                }d|j        d d d f<   |                                }d|j        d	d
gd d f<   t          j        ||           |                                }d|j        d d f<   |                                }d|j        d	d
gdf<   t          j        ||           |                                }d|j        d d f<   |                                }d|j        d	d
gdgf<   t          j        ||           |                                }d|j        d	d
gd f<   |                                }d|j        d	d
gdf<   t          j        ||           |                                }d|j        d	d
gd f<   |                                }d|j        d	d
gdgf<   t          j        ||           |                                }d|j        d df<   |                                }d|j        d	d
gdf<   t          j        ||           |                                }ddg|j        d dgf<   |                                }ddg|j        d	d
gdgf<   t          j        ||           d S )Nr[   r  r>   r  r  rg   r   c                 
    ddgS r  r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>  
    Aq6 r1   r   r;   r   c                 
    ddgS r  r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>  r
  r1   rp   c                 
    ddgS r  r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>  r
  r1   c                     dS r   r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>  s    Q r1      c                 
    ddgS r  r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>  r
  r1   c                     dgS r   r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>  s    aS r1   r   c                     dS r   r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>  s    1 r1   c                     dgS r   r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>  s    A3 r1   rz   c                 
    ddgS r  r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>  r
  r1   c                 
    ddgS r  r8   r   s    r/   r   zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>  r
  r1   )r   r   r   rF   rJ   r(   rO   rP   )r,   rS   r  r   s       r/    test_frame_iloc_setitem_callablez1TestILocCallable.test_frame_iloc_setitem_callable  s   ,,VDLL%G%G%GHHv,,
 
 
 ggii%&!!"ggii!Q
c3'''ggii(*!!111$%ggii !Q
c3'''ggii23!!;;./ggii!Q
c3'''ggii46!!==01ggii "!Q!
c3''' ggii(*!Q$%ggii !Q
c3'''ggii*,!Q&'ggii "!Q!
c3'''ggii(*!!1$%ggii !Q
c3'''ggii+-r(!!A3&'ggii!#R!Q!
c3'''''r1   N)r2   r3   r4   r  r  r8   r1   r/   r  r  r  s2        9 9 9<7( 7( 7( 7( 7(r1   r  c                   &    e Zd Zd Zd Zd Zd ZdS )TestILocSeriesc           
         t          t          j                            d                              d          t          t          ddd                              }|                                }t          t          |                    D ]7}|j	        |         }||j
        |                  }t          j        ||           8|j	        t          dd                   }|j        dd         }t          j        ||           t          j        d           5  t          j        |          5  d|d d <   d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |rt          j        ||           n'|j	        dd         dk                                    sJ |j	        g d	         }|                    |j
        g d	                   }t          j        ||           d S )
Nr   rz   r   ro   rg   r   r;   r\   )r   r   r;   r\   rp   )r   rM   r   r   r   r   rE   rJ   r   r(   rh   rO   r  r  r   r   r   rM  rN  reindex)	r,   rb   r   rl   ser_originalrC  r   r   rU   s	            r/   	test_iloczTestILocSeries.test_iloc  sI   I!!!$$44R88U1bRS__@U@U
 
 
 xxzzs3xx 	0 	0AXa[Fcil#C"63//// %1++&71Q3<
vx000 '-- 	 	&'9::  qqq	              	 	 	 	 	 	 	 	 	 	 	 	 	 	 	  	."35555HQqSMQ&++----- ///*;;sy9::
vx00000s6   E.E6EE	E	E	
EE Ec                 V    t          g dg d          }|j        d         dk    sJ d S )Nr   r   rg   r   )r   r(   )r,   rl   s     r/   test_iloc_getitem_nonuniquez*TestILocSeries.test_iloc_getitem_nonunique  s9    YYYiii000x{ar1   c                     t          g d          }t          g dg d          }|j        dd         |j        dd<   t          g d          }t          j        ||           d S )Nr   r   )r   r   r   rg   r   r;   )r   rp   r   )r   r(   rO   r   )r,   ser1ser2rU   s       r/   r  z4TestILocSeries.test_iloc_setitem_pure_position_based  sp    iii  iiiyyy1111Q3	!A#)))$$
tX.....r1   c                    t          dgt          j        gd          }t          j        t
          d          5  |j        d d df                             d          |j        d d df<   d d d            n# 1 swxY w Y   t          dgt          t          gd          d          }t          j
        ||           d S )Ntest)r   r  r   rt   r  r  r>   )r   rM   r   rO   r   r   r   rL   r   r   rP   r^  s      r/   #test_iloc_nullable_int64_size_1_nanz2TestILocSeries.test_iloc_nullable_int64_size_1_nan  s
   &99::'=QRRR 	D 	D!'AAAsF!3!:!:7!C!CFJqqq#v	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	DF8%G2L2L2LMMNN
fh/////s   1A77A;>A;N)r2   r3   r4   r  r  r  r$  r8   r1   r/   r  r    sP        1 1 1>     / / /0 0 0 0 0r1   r  )+r  r   renumpyrM   r5   pandas.errorsr   pandas.util._test_decoratorsutil_test_decoratorsr  pandasr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   pandas._testing_testingrO   pandas.api.typesr   pandas.tests.indexing.commonr   escaper  r   r:   r  r  r  r  r8   r1   r/   <module>r1     sz   0 0       				      ' ' ' ' ' ' ) ) ) ) ) ) ) ) )                                 "       & & & & & & K K K K K K ")6 
 
 
 
 
 
 
 
(HC HC HC HC HC HC HC HCV&4 4 4 4 4 4 4 4n1/ 1/ 1/ 1/ 1/ 1/ 1/ 1/hV( V( V( V( V( V( V( V(r20 20 20 20 20 20 20 20 20 20r1   