
    Owgb                         d Z ddlZddlZddlZddlmZmZmZm	Z	m
Z
mZmZ ddlmZ  G d d      Z G d d      Z G d d	      Zy)
zx
test setting *parts* of objects both positionally and label based

TODO: these should be split among the indexer tests
    N)	DataFrameIndexPeriodSeries	Timestamp
date_rangeperiod_rangec                   `    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zy)TestEmptyFrameSetitemExpansionc                 4   t        i t        j                  dd            }t        dt        j                  dd            }||d<   t        ddgdz  it        j                  dd      t	        dgt
        	      
      }t        j                  ||       y )Nr   df_indexnameindexGz?   series_indexseriesdtyper   columns)r   pd
RangeIndexr   r   objecttmassert_frame_equalselfdfr   expecteds       Y/var/www/horilla/myenv/lib/python3.12/site-packages/pandas/tests/indexing/test_partial.py,test_empty_frame_setitem_index_name_retainedzKTestEmptyFrameSetitemExpansion.test_empty_frame_setitem_index_name_retained   s}    rqz!BCBMM!.$IJ8vz"--
38*F3
 	b(+    c                    t               }t        dt        j                  dd            }||d<   t        ddgdz  it        j                  dd      t	        dgt
                    }t        j                  ||       y )	Nr   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   s       r#   -test_empty_frame_setitem_index_name_inheritedzLTestEmptyFrameSetitemExpansion.test_empty_frame_setitem_index_name_inherited&   sm    [BMM!.$IJ8vz"--78*F3

 	b(+r%   c                    t        ddg      }t        dt        d            |j                  d<   t        ddgdgt        j
                        }t        j                  ||       t        ddg      }t        ddg      |j                  d<   t        t        j                  dggddgdgd	      }t        j                  ||       y )
NABr      r   r   r   )r   r   r   float64)	r   r   rangelocnpr-   r   r   nan)r    r!   r"   exps       r#   -test_loc_setitem_zerolen_series_columns_alignzLTestEmptyFrameSetitemExpansion.test_loc_setitem_zerolen_series_columns_align2   s    Sz*1E!H-q	c3Zs"**M
b(+ Sz*1SE*q	"&&!Sz!IV
b#&r%   c                 V   t        ddg      }d}t        j                  t        |      5  g d|j                  d<   d d d        t        ddg      }dd	g|j                  d
<   t        dd	ggd
gddgt
        j                        }t        j                  ||       y # 1 sw Y   bxY w)Nr)   r*   r+   z(cannot set a row with mismatched columnsmatchr,         r         r9   )r   r   r   )	r   pytestraises
ValueErrorr/   r0   int64r   r   )r    r!   msgr2   s       r#   7test_loc_setitem_zerolen_list_length_must_match_columnszVTestEmptyFrameSetitemExpansion.test_loc_setitem_zerolen_list_length_must_match_columns@   s    Sz*8]]:S1 	"!BFF1I	" Sz*Fq	!Qc3ZrxxP
b#&	" 	"s   BB(c                    t               }d}t        j                  t        |      5  d|j                  d<   d d d        t        j                  t        |      5  t        dgdg      |j                  d<   d d d        d}t        j                  t        |      5  d|j                  d d df<   d d d        y # 1 sw Y   xY w# 1 sw Y   OxY w# 1 sw Y   y xY w)Nz*cannot set a frame with no defined columnsr5   r,   foor   z5cannot set a frame with no defined index and a scalar)r   r<   r=   r>   r/   r   )r    r!   r@   s      r#   test_partial_set_empty_framez;TestEmptyFrameSetitemExpansion.test_partial_set_empty_frameN   s     [:]]:S1 	BFF1I	 ]]:S1 	3s5'2BFF1I	3 F]]:S1 	BFF1a4L	 		 		3 	3	 	s#   B:CC:CCCc                    t        t        dgt              t        g d            }t        t        g d            }t        g d      |d<   t	        j
                  ||       t        t        g             }t        |j                        |d<   t	        j
                  ||       t        t        g             }|j                  |d<   t	        j
                  ||       y )NrC   r   r   r   r   r   )r   r   r   r   r   r   r   r    r"   r!   s      r#   test_partial_set_empty_frame2z<TestEmptyFrameSetitemExpansion.test_partial_set_empty_frame2_   s     5'0b8Q
 U2X672X.5	
b(+U2Y'288$5	
b(+U2Y'HH5	
b(+r%   c                    t        t        dgt              t        g d            }|d   j                  d      |d<   t        t        g d            }g |d<   t	        j
                  ||       t        t        g d            }t        t        j                  t        |            d      |d<   t	        j
                  ||       y )NrC   r   r?   rF   r-   r   )
r   r   r   astyper   r   r   r0   arangelenrG   s      r#   test_partial_set_empty_frame3z<TestEmptyFrameSetitemExpansion.test_partial_set_empty_frame3v   s    5'0b8P
 #5/00;U2W565	
b(+U2W56299SW-Y?5	
b(+r%   c                 
   t        t        g d            }t        t        |            |d<   t        t        dgt              t        g d            }|d   j                  d      |d<   t        j                  ||       y )Nr?   r   r   rC   rF   )r   r   r.   rL   r   rJ   r   r   r    r!   r"   s      r#   test_partial_set_empty_frame4z<TestEmptyFrameSetitemExpansion.test_partial_set_empty_frame4   sm    U2W56#b'N5	5'0b8P
 #5/009
b(+r%   c                 n   t               }t        j                  |j                  t	        j
                  d             t               }t        dgdg      |d<   t        dgdg      |j                  d d df<   t        j                  |t        dggdgdg             t        j                  ||       y )Nr   r,   rC   r   r   )	r   r   assert_index_equalr   r   r   r   r/   r   )r    r!   df2s      r#   test_partial_set_empty_frame5z<TestEmptyFrameSetitemExpansion.test_partial_set_empty_frame5   s    [
bjj"--*:;kE7+Aqc%1q!t
b)aSE%1#"NO
b#&r%   c           	      ^   t        dt        dt        d            ig d      }t        ddg      }t        dt        d            |d<   t        j                  ||       t        ddg      }t        dt        d            |j
                  d d df<   t        j                  ||       y )	Nr   r,   r   r   )r)   r*   r   r+   r)   r*   )r   r   r.   r   r   r/   rG   s      r#   %test_partial_set_empty_frame_no_indexzDTestEmptyFrameSetitemExpansion.test_partial_set_empty_frame_no_index   s    aq!:;]SSz*qa)1
b(+Sz*auQx0q!t
b(+r%   c                    t        g dt        g d            }|d   j                  d      |d<   |d   j                  d      |d<   |d   j                  d      |d<   t        g d	g d
d      }||j                  dkD     }t        j
                  |d<   t        j                  ||       t        g d      }|d   j                  d      |d<   t        g d      }d|d<   t        j                  ||       t        j                  |d   t        dt                     t        g d	g d
d      }||j                  dkD     }|j                  g d      }t        g d      }|d   j                  d      |d<   |d   j                  d      |d<   |d   j                  d      |d<   t        j                  ||       y )N)r)   r*   Newr?   r   rF   r)   r*   r-   rX   r7   )g333333?g@g@r)   r*      )abc cdr+   r^   )r[   r\   r]   r9   r]   r   r   )r)   r*   Cr`   )r   r   rJ   r)   r0   r1   r   r   assert_series_equalr   r   reindex)r    r"   r!   yresults        r#    test_partial_set_empty_frame_rowz?TestEmptyFrameSetitemExpansion.test_partial_set_empty_frame_row   s    %6eBg>VW ,,W5 ,,Y7"5/00;Y_=>rttaxL66%
a*%;< ,,W5013
b(+
r%y&e6*JK Y_=>rttaxL?3_5 ,,W5 ,,Y7 ,,Y7
fh/r%   c                 .   t        t        t                    }t        dt        t              i      }t        j                  ||       t        t        dt                    }t        dt        t              i      }t        j                  ||       y )Nr   r   rC   r_   )r   r   r   r   r   rO   s      r#   'test_partial_set_empty_frame_set_serieszFTestEmptyFrameSetitemExpansion.test_partial_set_empty_frame_set_series   sl     vF+,af!567
b(+v578eV&%9:;
b(+r%   c                     t        dg      }|j                         }d|d<   t        ddgt        dgt                    }t	        j
                  ||       y )Nr   r   r[   r   r   )r   copyr   r   r   r   rO   s      r#   2test_partial_set_empty_frame_empty_copy_assignmentzQTestEmptyFrameSetitemExpansion.test_partial_set_empty_frame_empty_copy_assignment   sM     aS!WWY3Qqc5#f3MN
b(+r%   c                 V   t        ddg      }ddg|d<   t        ddgt        j                  t        j                  gd      }t        j                  ||d       t        ddg      }d	d
g|d<   t        t        d	d
g|st        nd      t        t        j                  t        j                  gt              d      }t        j                  ||       t        ddg      }d|j                  d<   t        dgt        j                  gd      }t        j                  ||d       y )Nxrc   r+   r,   r8   )rl   rc   F)check_dtype12zstring[pyarrow_numpy]r   )r   rl   )r   r0   r1   r   r   r   r   r/   )r    using_infer_stringr!   r"   s       r#   0test_partial_set_empty_frame_empty_consistencieszOTestEmptyFrameSetitemExpansion.test_partial_set_empty_frame_empty_consistencies   s    Sz*a&3Aq60@AB
b(>Sz**3#J(:&@W RVVRVV,F;
 	b(+Sz*vA3bffX67
b(>r%   N)__name__
__module____qualname__r$   r'   r3   rA   rD   rH   rM   rP   rT   rV   re   rg   rj   rq    r%   r#   r   r      sH    ,
,''",., 	,'
,0<	,,?r%   r   c                      e Zd Zd Zej
                  j                  d      d        Zd Zd Z	d Z
d Zej
                  j                  dd	d
g      d        Zd Zej
                  j                  d eddd      g d edd       edd       edd      gf eddd      g d ed       ed       ed      gf ej(                  dd      g d ej*                  d       ej*                  d       ej*                  d      gfg      d        Zej
                  j                  d eddd      ddgf eddd      ddgf ej(                  dd      d d!gfg      d"        Zej
                  j                  d# eddd       ed$d%ge&      d'f eddd       ed$d%ge&      d'f ej(                  dd       eddge&      d(fg      d)        Zy*)+TestPartialSettingc                 J   t        g d      }|j                         }d|d<   t        g dg d      }t        j                  ||       |j                         }d|j                  d<   t        g dg d      }t        j                  ||       |j                         }d|d<   t        g dg d      }t        j                  ||       |j                         }d|j                  d<   t        g dg d      }t        j                  ||       |j                         }d}t        j                  t        |	      5  d|j                  d
<   d d d        d}t        j                  t        |	      5  d|j                  d
<   d d d        y # 1 sw Y   ?xY w# 1 sw Y   y xY w)Nr7   rZ   )r,   r8   r9   rZ   )r   r,   r8   rZ   r         @)r,   r8   r9   ry   %iloc cannot enlarge its target objectr5   r9   z/index 3 is out of bounds for axis 0 with size 3)
r   ri   r   ra   r/   r<   r=   
IndexErrorilociat)r    s_origsr"   r@   s        r#   test_partial_settingz'TestPartialSetting.test_partial_setting   sU    	"KKM!,l;
q(+KKMa,l;
q(+KKM!.=
q(+KKMa.=
q(+ KKM5]]:S1 	AFF1I	 @]]:S1 	AEE!H	 			 		 	s   ?F4FFF"z.ignore:Setting a value on a view:FutureWarningc                    t        t        j                  d      j                  dd      ddgd      }|j	                         }d}t        j                  t        |	      5  d
|j                  d<   d d d        d}|rd}t        j                  t        |	      5  d
|j                  d<   d d d        t        g dg dd      }|j	                         }|j                  d   |j                  d<   t        j                  ||       t        g dg dd      }|j	                         }|j                  d   |j                  d<   t        j                  ||       t        g dg dd      }|j	                         }|j                  d   |j                  d<   t        j                  ||       t        g dg dd      }|j	                         }|j                  d d df   |j                  d d df<   t        j                  ||       t        g dt        g d      d      }|j	                         }|d   j                  t        j                        |d<   |j                  d d df   |j                  d d df<   t        j                  ||       |j	                         }|d   |d<   |j	                         }|j                  d d df   |j                  d d df<   t        j                  ||       |j	                         }|d   |d<   |j	                         }|j                  d d df   |j                  d d df<   t        j                  ||       y # 1 sw Y   xY w# 1 sw Y   xY w)Nr:   r9   r8   r)   r*   r?   )r   r   rz   r5   ry   )r   r8   z/index 2 is out of bounds for axis 0 with size 2zlist index out of range)r   r   r   )r,   rZ   rZ   rY   r,   )r   r8   r   r   )r,   r9   rZ   rZ   )r   r8   r   )g        g       @g      @r`   )r   r0   rK   reshaperi   r<   r=   r{   r|   r}   r   r   r/   r   rJ   r-   )r    using_array_managerdf_origr!   r@   r"   s         r#   test_partial_setting_framez-TestPartialSetting.test_partial_setting_frame  s   IIaL  A&c
'

 \\^5]]:S1 	 BGGDM	  @+C]]:S1 	BFF4L	 99=>\\^WWQZ

b(+99=>\\^FF1Iq	
b(+ <lCD\\^FF1Iq	
b(+ 99=>\\^3q#v
b(+ 96/3JKL\\^S'..,3 3q#v
b(+ <<>3\\^3q#v
b(+ <<>3\\^3q#v
b(+k	  	 	 	s   !MM&M#&M0c           	         t        dd      }t        t        j                  j	                  d      j                  d      |g d      }t        j                  |t        dd	i|d
d  |j                  z         gd      }|j                         }d	|j                  |d
   |j                  z   df<   t        j                  ||       |j                         }d	|j                  |d
   |j                  z   df<   t        j                  ||       t        dd	i|d
d  |j                  z         }t        j                  ||gd      }|j                         }d	|j                  |d
   |j                  z   df<   t        j                  ||       |j                         }d	|j                  |d
   |j                  z   df<   t        j                  ||       y )Nz1/1/2000   )periodsr8   )r   r   )r)   r*   r`   Dr   r)   r;   r   T)sortr   r,   axis)r   r   r0   randomdefault_rngstandard_normalr   concatfreqri   r/   r   r   at)r    datesr   r"   r!   	exp_others         r#   test_partial_setting2z(TestPartialSetting.test_partial_setting2Z  s   :q1II!!!$44V<(
 99iabc
UZZ0GHIPT
 \\^./uRy5::%s*+
b(+\\^-.eBi%**$c)*
b(+q!fE"#J,CD	99gy1:\\^,-uRy5::%q()
b(+\\^+,eBi%**$a'(
b(+r%   c                 J   t        ddgddggddg      }|j                  d   j                         }d|_        t	        j
                  |t        |      j                  j                         g      }|j                  d   |j                  d<   t        j                  ||       y )NTr,   Fr8   femalefitnessr+   )
r   r/   ri   r   r   r   Tinfer_objectsr   r   )r    r!   r   r"   s       r#    test_partial_setting_mixed_dtypez3TestPartialSetting.test_partial_setting_mixed_dtypew  s     q	E1:.98MNFF1INN99b)A,..">">"@ABFF1Iq	
b(+r%   c                 
   t        ddgddg      }t        t        j                  dt        j                  gg d      }t        j                  t
        d      5  |j                  g d    d d d        |j                  g d      }t        j                  ||d	
       t        t        j                  dt        j                  t        j                  gg d      }t        j                  t
        d      5  |j                  g d    d d d        |j                  g d      }t        j                  ||d	
       t        g dg d      }|j                  g d   }t        j                  ||d	
       t        ddt        j                  dgg d      }t        j                  t
        d      5  |j                  g d    d d d        |j                  g d      }t        j                  ||d	
       dt        j                  t               d}t        j                  t
        |      5  |j                  g d    d d d        t        ddt        j                  gg d      }t        j                  t
        d      5  |j                  g d    d d d        |j                  g d      }t        j                  ||d	
       t        g dg d      }t        dt        j                  t        j                  gg d      }t        j                  t
        d      5  |j                  g d    d d d        |j                  g d      }t        j                  ||d	
       t        g dg d      }t        t        j                  ddgg d      }t        j                  t
        d      5  |j                  g d    d d d        |j                  g d      }t        j                  ||d	
       t        g dg d      }t        t        j                  ddgg d      }t        j                  t
        d      5  |j                  g d    d d d        |j                  g d      }t        j                  ||d	
       t        g dg d      }t        dt        j                  t        j                  gg d      }t        j                  t
        d      5  |j                  g d    d d d        |j                  g d      }t        j                  ||d	
       t        g dg d      }t        dt        j                  t        j                  gg d      }t        j                  t
        d      5  |j                  g d    d d d        |j                  g d      }t        j                  ||d	
       t        g dg d       }|j                  g d!   }t        j                  ||d	
       y # 1 sw Y   xY w# 1 sw Y   	xY w# 1 sw Y   [xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   	xY w# 1 sw Y   wxY w# 1 sw Y   xY w)"N皙?皙?r,   r8   r   r9   r8   r9   not in indexr5   Tcheck_index_typer9   r8   r9   rl   r   r   r   r8   r8   r,   r8   r8   rl   r,   '\"None of \[Index\(\[3, 3, 3\], dtype='z'\)\] are in the \[index\]\"r9   r9   r9   r8   r8   r9   r   r   333333?r7   r   r9   r   r   r   r   r   皙?r,   r8   r9   r   rZ   r9   r9   r   rZ   r   r   r   rZ   r:   r;   r;   r8   r8   r   rZ   rZ   r   r   r   r   r8   r8   r,   r,   r,   r,   r   r   )r   r0   r1   r<   r=   KeyErrorr/   rb   r   ra   r   intr|   )r    serr"   rd   r@   r   s         r#   test_series_partial_setz*TestPartialSetting.test_series_partial_set  s    c3Z1v. 2663/yA]]8?; 	GGI	 Y'
vx$G26637~N]]8>: 	$GGN#	$ ^,
vx$G/;#
vx$G3RVVS1H]]8>: 	$GGN#	$ ^,
vx$G 7rxx}o F& & 	 ]]83/ 	GGI	 3RVV,I>]]8>: 	GGI	 Y'
vx$G?)43/yA]]8>: 	EE)	 9%
vx$G'|<2663,I>]]8>: 	EE)	 9%
vx$G'|<2663,I>]]8>: 	EE)	 9%
vx$G'|<3/yA]]8>: 	EE)	 9%
vx$G'|<3/yA]]8>: 	EE)	 9%
vx$G .lC,'
vx$Ge	 		$ 	$	$ 	$	 		 		 		 		 		 		 	sx   X8X3X0X+X8$Y5YY%Y,Y9XXX(+X58YYYY),Y69Zc                    t        ddgdd      }t        ddg|d	      }t        j                  t        d
      5  |j
                  g d    d d d        t        j                  t        d      5  |j
                  g d    d d d        t        g ddd      }t        g d|d	      }|j
                  g d   }t        j                  ||d       t        j                  t        d      5  |j
                  g d    d d d        dt        j                  t               d}t        j                  t        |      5  |j
                  g d    d d d        t        j                  t        d      5  |j
                  g d    d d d        t        g ddd      }t        j                  t        d      5  t        g d|d	      j
                  g d    d d d        t        g ddd      }t        j                  t        d      5  t        g d|d	      j
                  g d    d d d        t        g ddd      }t        j                  t        d      5  t        g d|d	      j
                  g d    d d d        t        g d dd      }t        j                  t        d      5  t        g d|d	      j
                  g d!    d d d        t        g ddd      }t        j                  t        d      5  t        g d|d	      j
                  g d"    d d d        t        g d#dd      }t        g d$|d	      }|j                  g d%   }t        j                  ||d       y # 1 sw Y   -xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   OxY w# 1 sw Y   'xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   UxY w# 1 sw Y   xY w# 1 sw Y   xY w)&Nr,   r8   r?   idxr   r   r   r   r   )r   r   z\[3\] not in indexr5   r   r   r   r   r   Tr   z\['x'\] not in indexr   r   z(', name='idx'\)\] are in the \[index\]\"r   r   r7   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   r<   r=   r   r/   r   ra   r0   r   r   r|   )r    r   r   exp_idxr"   rd   r@   s          r#   !test_series_partial_set_with_namez4TestPartialSetting.test_series_partial_set_with_name  sF    QF'6c3Zs5 ]]8+@A 	GGI	 ]]8?; 	$GGN#	$ 	u=/sC#
vx$G]]8+BC 	$GGN#	$
 7rxx}o F5 5 	 ]]83/ 	GGI	 ]]8>: 	GGI	 IW59]]8>: 	H?#C8<<YG	H Le<]]8>: 	M's=AA)L	M Le<]]8>: 	M's=AA)L	M Le<]]8>: 	M's=AA)L	M Le<]]8>: 	M's=AA)L	M G%@.gCH,'
vx$Gc	 		$ 	$	$ 	$	 		 		H 	H	M 	M	M 	M	M 	M	M 	Msw   M91N/NN 6N-; N: O! O4 O! O.9NNN N*-N7:OOO!O+.O7keyd   g      Y@c           	      l   t        t        j                  j                  d      j	                  d      t        t        d      t              t        ddd      	      }|j                         }|j                  d
   |j                  |d d f<   t        t        |j                        |gz   t        |j                  j                        }t        j                  |j                  |j                  d
g   j                  gd
      }t        |||j                         }t#        j$                  ||       y )Nr8   
   r   ABCDr   
2000-01-01r   r*   r   r   rF   r   r   r   r   )r   r0   r   r   r   r   listr   r   ri   r|   r/   r   r   concatenatevaluesr   r   r   )r    r   origr!   ex_indexex_datar"   s          r#   6test_setitem_with_expansion_numeric_into_datetimeindexzITestPartialSetting.test_setitem_with_expansion_numeric_into_datetimeindex  s     II!!!$44W=$v,f5\2C@

 YY[sAvdjj)SE1djjooV..$++rwws|/B/B!C!LWHdllK
b(+r%   c           	         t        t        j                  j                  d      j	                  d      t        t        d      t              t        ddd      	      }|j                         }|j                  d
   |j                  dd d f<   t        |j                  d
   d      }t        j                  |t        |      j                  j!                         g      }t#        j$                  ||       t#        j&                  |j(                  t        |j(                  j+                         dgz                |j(                  j,                  dk(  sJ y )Nr8   r   r   r   r   r   r*   r   rF   r   r[   r   r   )r   r0   r   r   r   r   r   r   r   ri   r|   r/   r   r   r   r   r   r   r   rR   r   tolistr   )r    r   r!   r   r2   s        r#   test_partial_set_invalidz+TestPartialSetting.test_partial_set_invalid)  s     II!!!$44W=$v,f5\2C@
 YY[sAvRWWQZc*iiy~//==?@A
b#&
bhhdjj.?.?.ASE.I(JKxx~~)))r%   zidx,labels,expected_idx2000   r   )startr   r   )
2000-01-04
2000-01-08
2000-01-12r   )r   r   r   z1 day)r   r   )4D8D12Dz4 dayz8 dayz12 dayc                      |t        d      |      }g d} |||      }t        j                  ||j                  |          |t        u rt        j
                  |||          y y )Nr   r   )r9   r;      )r.   r   assert_equalr/   r   ra   )r    r   labelsexpected_idxframe_or_seriesobjexpected_valuer"   s           r#   4test_loc_with_list_of_strings_representing_datetimeszGTestPartialSetting.test_loc_with_list_of_strings_representing_datetimes<  s]    @ eBis3#"><@
#''&/2f$""8S[9 %r%   z
idx,labelsz
2000-01-30z3 dayz30 dayc                    t        t        d      |      }t        t        d      |      }d}t        j                  t
        |      5  |j                  |    d d d        t        j                  t
        |      5  ||    d d d        t        j                  t
        |      5  |j                  |    d d d        y # 1 sw Y   fxY w# 1 sw Y   IxY w# 1 sw Y   y xY w)Nr   r   r   r5   r   r.   r   r<   r=   r   r/   )r    r   r   r   r!   r@   s         r#   Btest_loc_with_list_of_strings_representing_datetimes_missing_valuezUTestPartialSetting.test_loc_with_list_of_strings_representing_datetimes_missing_valuee  s    $ U2Yc*uRy,]]83/ 	GGFO	]]83/ 	K	]]83/ 	FF6N	 			 		 		 	s$   
B?=C&C?CCC zidx,labels,msgr   r   r   zHNone of \[Index\(\['4D', '8D'\], dtype='object'\)\] are in the \[index\]zXNone of \[Index\(\['2000-01-04', '2000-01-08'\], dtype='object'\)\] are in the \[index\]c                    t        t        d      |      }t        t        d      |      }t        j                  t
        |      5  |j                  |    d d d        t        j                  t
        |      5  ||    d d d        t        j                  t
        |      5  |j                  |    d d d        y # 1 sw Y   fxY w# 1 sw Y   IxY w# 1 sw Y   y xY w)Nr   r   r5   r   )r    r   r   r@   r   r!   s         r#   Etest_loc_with_list_of_strings_representing_datetimes_not_matched_typezXTestPartialSetting.test_loc_with_list_of_strings_representing_datetimes_not_matched_type  s    B U2Yc*uRy,]]83/ 	GGFO	]]83/ 	K	]]83/ 	FF6N	 			 		 		 	s$   B=;C	$C=C	CCN)rr   rs   rt   r   r<   markfilterwarningsr   r   r   r   r   parametrizer   r   r	   r   r   r   r   timedelta_range	Timedeltar   r   r   r   r   ru   r%   r#   rw   rw      sv   #J [[ PQ>, R>,@,:
,YHv8Ht [[US%L1, 2, *& [[! 62C@:<c2<c2<c2 #>:l+l+l+ #"""=#g&W(=|r||H?UV'	
8:98: [[ 62C@|,
 #>|,  Rgr:Wh<OP
	
 [[ 62C@tTl&1,	 #>tTl&1,	 #"""=|\2&A?	#	
:;:r%   rw   c                       e Zd Zd Zy)TestStringSlicingc           	      Z   t        j                  g d      }t        t        t	        |            |      }t        t        t	        |d d             |d d       }t        j                  t        d      5  |dd  d d d        |dd }t        j                  ||       y # 1 sw Y   %xY w)	N)
2012-01-01z
2012-01-02z
2012-01-03Nr   r9   z non-existing keys is not allowedr5   r   z
2012-01-04z2012-01-03 00:00:00.000000000)
r   to_datetimer   r.   rL   r<   r=   r   r   r   )r    r   r!   r"   rd   s        r#   ,test_slice_irregular_datetime_index_with_nanz>TestStringSlicing.test_slice_irregular_datetime_index_with_nan  s    OPuSZ(6U3uRay>2%)D]]8+MN 	* |L)		* L!@A
fh/	* 	*s   7B!!B*N)rr   rs   rt   r   ru   r%   r#   r   r     s    0r%   r   )__doc__numpyr0   r<   pandasr   r   r   r   r   r   r   r	   pandas._testing_testingr   r   rw   r   ru   r%   r#   <module>r      sM         Y? Y?xx xv0 0r%   