
    .i[                         d dl Zd dlZd dlmZ d dlmZmZmZm	Z	m
Z
 d dlmZ d dlmZm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 G d d      Zy)    N)InvalidIndexError)NAIndex
RangeIndexSeries	Timestamp)ArrowExtensionArrayFloatingArrayc                       e Zd Zd Zd Zd Zd Zd Zej                  j                  ddgdg ed	      gd
gg      d        Zej                  j                  dg d      d        Zd Zy)
TestGetLocc                 J    t        g d      }|j                  d      dk(  sJ y )Nr         r   )r   get_locselfindexs     h/var/www/app/trading-bot/venv/lib/python3.12/site-packages/pandas/tests/indexes/numeric/test_indexing.pytest_get_loczTestGetLoc.test_get_loc   s#    i }}Q1$$$    c                     t        g d      }t        j                  t        d      5  |j	                  ddg       d d d        y # 1 sw Y   y xY w)Nr   z\[1, 2\]matchr   r   )r   pytestraisesr   r   r   s     r   test_get_loc_raises_bad_labelz(TestGetLoc.test_get_loc_raises_bad_label   s@    i ]],K@ 	"MM1a&!	" 	" 	"s   AAc                 F   t        g dt        j                        }t        j                  t
        d      5  |j                  d       d d d        t        j                  t
        d      5  |j                  d       d d d        t        j                  t
        d      5  |j                  d	       d d d        t        j                  t
        d
      5  |j                  d       d d d        y # 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   y xY w)Ng              ?       @dtypez^'foo'$r   fooz^1\.5$      ?z^True$Tz^False$F)r   npfloat64r   r   KeyErrorr   r   idxs     r   test_get_loc_float64zTestGetLoc.test_get_loc_float64   s    O2::6]]895 	KK	]]895 	KK	]]884 	KK	]]895 	KK	 		 		 		 		 	s/   C3.C?#DD3C<?DDD c                 r   t        t        j                  ddgt        j                        }|j	                  d      dk(  sJ |j	                  t        j                        dk(  sJ t        t        j                  dt        j                  gt        j                        }|j	                  d      dk(  sJ d}t        j                  t        |      5  |j                  t        j                         d d d        t        t        j                  dt        j                  t        j                  gt        j                        }|j	                  d      dk(  sJ d}t        j                  t        |      5  |j                  t        j                         d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)Nr   r   r"   r   z7'Cannot get left slice bound for non-unique label: nan'r   z6'Cannot get left slice bound for non-unique label: nan)	r   r&   nanr'   r   r   r   r(   
slice_locs)r   r*   msgs      r   test_get_loc_nazTestGetLoc.test_get_loc_na*   s7   RVVQN"**5{{1~"""{{266"a'''RVVQ'rzz:{{1~""" H]]83/ 	#NN266"	# RVVQ/rzzB{{1~"""F]]83/ 	#NN266"	# 	#	# 	#	# 	#s    F!8 F-!F*-F6c                 *   t        ddgt        j                        }|j                  d      dk(  sJ t	        j
                  t        d      5  |j                  d       d d d        t	        j
                  t        d      5  |j                  t        j                         d d d        t	        j
                  t        d	      5  |j                  t        j                  g       d d d        y # 1 sw Y   xY w# 1 sw Y   ZxY w# 1 sw Y   y xY w)
Nr   r   r"   r   z^3$r      z^nan$z\[nan\])	r   r&   r'   r   r   r   r(   r-   r   r)   s     r   test_get_loc_missing_nanz#TestGetLoc.test_get_loc_missing_nan=   s    QF"**-{{1~"""]]862 	KKN	]]873 	 KK	 ]],J? 	"KK!	" 	"		 		  	 	" 	"s$   C1 C=!D	1C:=D	Dvalsr   r    z
2019-12-31testc                     t        |      }t        j                  t        d      5  |j	                  t
        j                         d d d        y # 1 sw Y   y xY w)Nr-   r   )r   r   r   r(   r   r&   r-   )r   r4   r*   s      r   (test_get_loc_float_index_nan_with_methodz3TestGetLoc.test_get_loc_float_index_nan_with_methodI   s@     Dk]]851 	 KK	  	  	 s    AAr#   )f8i8u8c                     t        j                  d|      }t        |      }t        j                  t
        d      5  |j                  d        d d d        y # 1 sw Y   y xY w)Ni r"   Noner   )r&   aranger   r   r   r(   r   )r   r#   arrr*   s       r   %test_get_loc_numericindex_none_raisesz0TestGetLoc.test_get_loc_numericindex_none_raisesP   sL     iiU+Cj]]862 	KK	 	 	s   AA"c                    t        g d      }t        j                  t        j                        j                  dz   }t        j                  t        t        |            5  |j                  |       d d d        t        j                  t        t        |            5  |j                  j                  |       d d d        y # 1 sw Y   RxY w# 1 sw Y   y xY w)N)r   r   r   r   r   )r   r&   iinfoint64maxr   r   r(   strr   _engine)r   r*   vals      r   test_get_loc_overflowsz!TestGetLoc.test_get_loc_overflowsX   s    Ihhrxx $$q(]]83s84 	KK	]]83s84 	%KK$	% 	%	 		% 	%s   "C CCCN)__name__
__module____qualname__r   r   r+   r0   r3   r   markparametrizer   r7   r?   rG    r   r   r   r      s    %"

#&
" [[VqcC59\3J2KfX%VW  X  [[W&89 :	%r   r   c                   .   e Zd Zd Zej
                  j                  dddg      ej
                  j                  dg ddfg ddfg d	d
fg d	dfg      d               Zd Zej
                  j                  dddg dg dfd
dg dg dfddg dg dfddg dg dfd
dg dg dfddg dg dfddg dg dfd
dg dg dfddg dg dfddg dg dfd
dg dg dfddg dg dfddg dg dfd
dg dg dfddg dg dfg      d        Z	ej
                  j                  de
eeej                  g      ej
                  j                  dg dg dgg d g dgg d!g d"gg      d#               Zd$ Zej
                  j                  d%dg d&fd
g d'fdg d(fg      d)        Zej
                  j                  d*g d+      ej
                  j                  d,d-d.g      d/               Zej
                  j                  d,g d0      d1        Zd2 Zd3 Zd4 Zd5 Zd6 Zej
                  j                  d7d8d9d:efeefg      d;        Zd< Zd= Zej
                  j                  d>d:d?g      d@        Zej
                  j                  dAdBdCg      dD        ZdE Zy)FTestGetIndexerc                     t        g d      }t        g d      }|j                  |      }t        j                  g dt        j                        }t        j                  ||       y )Nr   r   r2         r   rR      )r   r2   r"   )r   get_indexerr&   arrayintptmassert_almost_equal)r   index1index2r1e1s        r   test_get_indexerzTestGetIndexer.test_get_indexere   sJ    'y!'XXj0
r2&r   reverseTFzexpected,method)rV   r   r   r   r   padffill)r   r   r   r   r   backfillbfillc                     t        g d      }t        g d      }t        j                  |t        j                        }|r|d d d   }|d d d   }|j	                  ||      }t        j                  ||       y )NrQ   rT   r"   rV   method)r   r&   rX   rY   rW   rZ   r[   )r   ra   expectedrh   r\   r]   results          r   test_get_indexer_methodsz'TestGetIndexer.test_get_indexer_methodsm   sn     'y!88HBGG4DbD\F"~H##F6#:
vx0r   c                 T   t        t        j                  d            }t        j                  t
        d      5  |j                  ddgd       d d d        t        j                  t
        d      5  |j                  ddgd       d d d        y # 1 sw Y   CxY w# 1 sw Y   y xY w)	N
   ztolerance argumentr   r   r   )	tolerancelimit argument)limitr   r&   r=   r   r   
ValueErrorrW   r   s     r   test_get_indexer_invalidz'TestGetIndexer.test_get_indexer_invalid   s    biim$]]:-AB 	3q!f2	3 ]]:-=> 	/q!fA.	/ 	/	3 	3	/ 	/s   B3BBB'z$method, tolerance, indexer, expectedNr   rS   	   nearestr   皙?g?      !@)r   r      )r   r   ru   )r   r   ru   r   rx   )r   rV   rV   )rV   r   rV   r   r   rV   c                     t        t        j                  d            }|j                  |||      }t	        j
                  |t        j                  |t        j                               y )Nrm   rh   rn   r"   r   r&   r=   rW   rZ   assert_numpy_array_equalrX   rY   )r   rh   rn   indexerri   r   actuals          r   test_get_indexer_nearestz'TestGetIndexer.test_get_indexer_nearest   sL    * biim$""76Y"O
##FBHHXRWW,MNr   listtypeztolerance, expected)333333?r   皙?)rx   r   r   )r         ?r   )rV   r   ru   c                     t        t        j                  d            }|j                  g dd ||            }t	        j
                  |t        j                  |t        j                               y )Nrm   rw   rv   r}   r"   r~   )r   rn   ri   r   r   r   s         r   +test_get_indexer_nearest_listlike_tolerancez:TestGetIndexer.test_get_indexer_nearest_listlike_tolerance   sX     biim$""I)9L # 
 	##FBHHXRWW,MNr   c                 \   t        t        j                  d            }t        j                  t
        d      5  |j                  ddgdd       d d d        t        j                  t
        d      5  |j                  ddgdg d	
       d d d        y # 1 sw Y   FxY w# 1 sw Y   y xY w)Nrm   ro   r   r   r   rv   )rh   rp   ztolerance size must matchr   r   r2   r}   rq   r   s     r   test_get_indexer_nearest_errorz-TestGetIndexer.test_get_indexer_nearest_error   s    biim$]]:-=> 	Aq!fYa@	A ]]:-HI 	Mq!fY)L	M 	M	A 	A	M 	Ms   B4B"B"B+zmethod,expected)rz      r   )ru   rz   r   )ru   r   r   c                    t        t        j                  d            d d d   }|j                  g d|      }t	        j
                  |t        j                  g dt        j                               |j                  g d|      }t	        j
                  |t        j                  |t        j                               y )Nrm   rV   rt   rg   )ru   rR   r   r"   rw   r~   )r   rh   ri   r   r   s        r   #test_get_indexer_nearest_decreasingz2TestGetIndexer.test_get_indexer_nearest_decreasing   s    
 biim$TrT*""9V"<
##FBHHYbgg,NO""?6"B
##FBHHXRWW,MNr   	idx_dtype)rB   r'   uint64rangerh   rW   get_indexer_non_uniquec                    |dk(  rt        d      }n t        t        j                  d|            }t        g d      } t	        ||      |      }t        j
                  g dt        j                        }|dk(  rt        j                  ||       y t        j                  dt        j                        }t        j                  |d   |       t        j                  |d	   |       y )
Nr   rR   r"   )TFT)rV   rV   rV   rW   r2   r   r   )	r   r   r&   r=   getattrrX   rY   rZ   r   )r   rh   r   numeric_indexotherrj   ri   missings           r   -test_get_indexer_numeric_index_boolean_targetz<TestGetIndexer.test_get_indexer_numeric_index_boolean_target   s    
 &qMM!"))AY"?@M)*//688L8]"''9ii1G''q	8<''q	7;r   )rb   rd   rv   c                 D   t        g d      }t        ddg      }t        j                  t        d      5  |j	                  ||       d d d        t        j                  t        d      5  |j	                  ||       d d d        y # 1 sw Y   AxY w# 1 sw Y   y xY w)Nr   TFzCannot comparer   rg   )r   r   r   	TypeErrorrW   )r   rh   leftrights       r   ,test_get_indexer_with_method_numeric_vs_boolz;TestGetIndexer.test_get_indexer_with_method_numeric_vs_bool   s    YtUm$]]9,<= 	3U62	3 ]]9,<= 	3d62	3 	3	3 	3	3 	3s   B
-B
BBc                    t        g d      }t        ddg      }|j                  |      }dt        j                  t	        |      t        j
                        z  }t        j                  ||       |j                  |      }dt        j                  t	        |      t        j
                        z  }t        j                  ||       |j                  |      d   }dt        j                  t	        |      t        j
                        z  }t        j                  ||       |j                  |      d   }dt        j                  t	        |      t        j
                        z  }t        j                  ||       y )Nr   TFrV   r"   r   )	r   rW   r&   oneslenrY   rZ   r   r   )r   r   r   resri   s        r    test_get_indexer_numeric_vs_boolz/TestGetIndexer.test_get_indexer_numeric_vs_bool   s   YtUm$u%E
"''::
##C2%D	99
##C2))%03E
"''::
##C2**403D	99
##C2r   c                    t        g dt        j                        }t        j                  |j                  |      t        j                  g dt        j                               g d}t        j                  |j                  |d      t        j                  g dt        j                               t        j                  |j                  |d      t        j                  g dt        j                               t        j                  |j                  |d      t        j                  g d	t        j                               y )
Nr   r"   r   )gr   g?rb   )rV   r   r   rd   rv   )r   r   r   )r   r&   r'   rZ   r   rW   rX   rY   )r   r*   targets      r   test_get_indexer_float64z'TestGetIndexer.test_get_indexer_float64  s    O2::6
##OOC "((9BGG"D	
 "
##OOFE*BHHZrww,O	
 	##OOFJ/)2771S	
 	##OOFI."''0R	
r   c                    t        ddt        j                  gt        j                        j	                  t        j                  g      }t        j
                  dgt        j                        }t        j                  ||       y )Nr   r   r"   )	r   r&   r-   r'   rW   rX   rY   rZ   r   )r   rj   ri   s      r   test_get_indexer_nanz#TestGetIndexer.test_get_indexer_nan  sS    1bff~RZZ8DDbffXN88QCrww/
##FH5r   c                 @   t        t        ddd      t        j                        }t        t        j                  d      t        j                        }|j                  |      }t        j                  g dt        j                        }t        j                  ||       t        t        j                  d      t        j                        }|j                  |d      }t        j                  g d	t        j                        }t        j                  ||       t        t        j                  d      t        j                        }|j                  |d
      }t        j                  g dt        j                        }t        j                  ||       y )Nr      r   r"   rm   )
r   rV   r   rV   r   rV   r2   rV   rR   rV   rb   rg   )
r   r   r   r   r   r   r2   r2   rR   rR   rd   )
r   r   r   r   r   r2   r2   rR   rR   rS   )
r   r   r&   rB   r=   rW   rX   rY   rZ   r   )r   r   r   r   ri   s        r   test_get_indexer_int64z%TestGetIndexer.test_get_indexer_int64  s   eAr1oRXX6ryy}BHH5##F+88?rwwO
##GX6ryy}BHH5##F5#988:"''J
##GX6ryy}BHH5##F:#>88:"''J
##GX6r   c                 L   t        g dt        j                        }t        t        j                  d      j	                  d      dz  dz         }|j                  |      }t        j                  g dt        j                        }t        j                  ||       t        t        j                  d      j	                  d      dz  dz         }|j                  |d	      }t        j                  g d
t        j                        }t        j                  ||       t        t        j                  d      j	                  d      dz  dz         }|j                  |d	      }t        j                  g dt        j                        }t        j                  ||       y )N)            l   
        l           l           l           r"   rm   r   rS   r   )
r   rV   r   r   r2   rR   rV   rV   rV   rV   rb   rg   )
r   r   r   r   r2   rR   rR   rR   rR   rR   rd   )
r   r   r   r   r2   rR   rV   rV   rV   rV   )
r   r&   r   r=   astyperW   rX   rY   rZ   r   )r   index_larger   r   ri   s        r   test_get_indexer_uint64z&TestGetIndexer.test_get_indexer_uint64*  s6   C))
 ryy}++H59EAB))&188?rwwO
##GX6ryy}++H59EAB))&)?88:"''J
##GX6ryy}++H59EAB))&)D88>bggN
##GX6r   z	val, val2)rR   rS   )rR   rR   rR   c                     t        ddd||g|      }|j                  d      }|dk(  sJ t        j                  t        d      5  |j                  d       d d d        y # 1 sw Y   y xY w)Nr   r   r2   r"   9r   ru   )r   r   r   r   r(   )r   rF   val2any_numeric_ea_and_arrow_dtyper*   rj   s         r   test_get_loc_maskedz"TestGetIndexer.test_get_loc_masked>  sc     Q1c4(0NOQ{{]]83/ 	KKN	 	 	s   A!!A*c                    t        ddt        g|      }|j                  t              }|dk(  sJ t        ddt        t        g|      }|j                  t              }t        j                  |t        j                  g d             t        g d|      }t        j                  t        d      5  |j                  t               d d d        y # 1 sw Y   y xY w)Nr   r   r"   FFTTr   r   r   )
r   r   r   rZ   r   r&   rX   r   r   r(   )r   r   r*   rj   s       r   test_get_loc_masked_naz%TestGetIndexer.test_get_loc_masked_naH  s    Q2J&DER{{Q2rN*HIR
##FBHH5O,PQI%CD]]840 	KKO	 	 	s   4CCc           
         t        j                  g d      }|rd|d<   t        t        t        j                  dddt         j                  g      |            }|rx|j                  t              }t        j                  g d      }t        j                  ||       |j                  t         j                        }t        j                  ||       nB|j                  t              }|dk(  sJ |j                  t         j                        }|dk(  sJ t        t        t        j                  g d	      t        j                  g d
                  }|j                  t              }|dk(  sJ |r&|j                  t         j                        }|dk(  sEJ t        j                  t        d      5  |j                  t         j                         d d d        t        j                  g d      }|rd|d<   t        t        t        j                  ddt         j                  g      |            }|j                  t         j                        }|dk(  sJ |r|j                  t              }|dk(  sJ y t        j                  t        d      5  |j                  t               d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)N)FFTFTrV   r   r   )maskr   r2   )r   r   r    )FFTr-   r   )FFFr   )r&   rX   r   r
   r-   r   r   rZ   r   r   r   r(   )r   using_nan_is_nar   r*   rj   ri   s         r   test_get_loc_masked_na_and_nanz-TestGetIndexer.test_get_loc_masked_na_and_nanV  s   xx34DHM"((Aq!RVV+<"=DIJ[[_Fxx :;H''9[[(F''9[[_FQ;;[[(FQ;;"((;/bhh?S6TU
 R{{[[(FQ;;xu5 $BFF#$ xx-.DHM"((Aq"&&>":FGRVV${{[[_FQ;;xt4  B   $ $   s   5 J4K 4J= K	rF   r   c                     t        ddt        d|g|      }|j                  dt        dg      }t        j                  g d      }t        j                  ||d       y )	Nr   r   r2   r"   rS   r{   F)check_dtype)r   r   get_indexer_forr&   rX   rZ   r   )r   r   rF   r*   rj   ri   s         r   test_get_indexer_masked_naz)TestGetIndexer.test_get_indexer_masked_na  sR     Q2q#&.LM$$aQZ088J'
##FH%Hr   r#   booleanbool[pyarrow]c                     |dk(  rt        j                  d       t        ddt        g|      }|j	                  d      }|dk(  sJ |j	                  t              }|dk(  sJ y )Nr   pyarrowTFr"   r   r   )r   importorskipr   r   r   )r   r#   r*   rj   s       r   "test_get_indexer_masked_na_booleanz1TestGetIndexer.test_get_indexer_masked_na_boolean  s`     O#	*T5"%U3U#{{R{{r   c                    t        j                  d      }t        t        |j	                  ddg|j                  |j                         |j                                                 }t        dg      }|j                  |      }t        j                  ddgt        j                        }t        j                  ||       |j                  |      \  }}t        j                  ddgt        j                        t        j                  dgt        j                        }	}t        j                  ||       t        j                  ||	       y )Nr   r   r   )typer   rV   r"   )r   r   r   r	   rX   
dictionaryint8rW   r&   rB   rZ   r   r   )
r   par   r*   rj   ri   result_1result_2
expected_1
expected_2s
             r   (test_get_indexer_arrow_dictionary_targetz7TestGetIndexer.test_get_indexer_arrow_dictionary_target  s      +!QbmmBGGIrwwy&IJ

 QCj(88QG2884
##FH5 77?(HHaWBHH-HHaS) 
 	##Hj9
##Hj9r   ) rH   rI   rJ   r`   r   rK   rL   rk   rs   r   listtupler   r&   rX   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rM   r   r   rO   rO   d   s,   ' [[Yu6[[u%w'j)g&		
	1 7	1/ [[.D)Y/y)4i3Ay),Iy19i0D/95	:oy9A	2OY7?I6C+6o{;_j9	
(O)(O [[Z$vrxx)HI[[j)k*j)	
O JOM [[
	j)4y)6LMO	O [[[*QR[[X7O'PQ< R S<& [[X'EF3 G33(
"67"7( [[[66Ar7RH*MN O+ Z [[UQF+I ,I [[Wy/&BC D:r   rO   c                       e Zd Zej                  j                  d e ej                  dd             e e	ddd      ej                         e ej                  dd            g      d	        Zd
 Zd Zy)	TestWherer   rS   r'   r"   r   r   r   r   c                 L   dgt        |      z  }|}|j                   ||            }dgdgt        |      dz
  z  z   }t        |j                  g|dd  j	                         t
        j                        }|j                   ||            }t        j                  ||       y )NTFr   r"   )	r   wherer   	_na_valuetolistr&   r'   rZ   assert_index_equal)r   listlike_boxr   condri   rj   s         r   
test_wherezTestWhere.test_where  s     vE
"\$/0w$3u:>22%//?E!"I,<,<,>?rzzR\$/0
fh/r   c                    t        g dt        j                        }t        j                  g d      }t        j                  dgt        j                        }t        g dt        j                        }|j                  ||      }t        j                  ||       |j                  | |      }t        j                  ||       y )N)r   rU   r   r"   )FTFr   )r   rU   r   )	r   r&   r   rX   rB   r   rZ   r   putmask)r   r*   r   r   ri   rj   s         r   test_where_uint64zTestWhere.test_where_uint64  s    IRYY/xx,-!BHH-"))44'
fh/dUE*
fh/r   c                     t        dt        j                  g      }|j                         }t        ddgd      }t        ddg      }|j	                  ||      }t        j                  ||       y )Nr   abstringr"   r    )r   r&   r-   notnar   rZ   r   )r   r   r   r   ri   rj   s         r   Ctest_where_infers_type_instead_of_trying_to_convert_string_to_floatzMTestWhere.test_where_infers_type_instead_of_trying_to_convert_string_to_float  s]    q"&&k"{{}sCj1#s$T5)
fh/r   N)rH   rI   rJ   r   rK   rL   r   r&   r=   r   rB   r   r   r   rM   r   r   r   r     su    [[)"))AY/0%2q/2)"))AX./	
000	0r   r   c                      e Zd Zej                  j                  dej                  ej                  ej                  g      d        Z
d Zej                  j                  dej                  ej                  g      d        Zy)TestTaker   c                     t        g d|d      }|j                  g d      }|j                  |j                  k(  sJ y )N)r   r   r2   rR   r$   r#   name)r2   r   r   )r   taker   )r   r   r   takens       r   test_take_preserve_namez TestTake.test_take_preserve_name  s4    l)%@

9%zzUZZ'''r   c                    t        g ddt        j                        }|j                  t        j                  g d            }t        g dt        j                  d      }t        j                  ||       |j                  t        j                  g d      d      }t        d	d
t        j                  gt        j                  d      }t        j                  ||       |j                  t        j                  g d      dd      }t        g dt        j                  d      }t        j                  ||       d}t        j                  t        |      5  |j                  t        j                  g d      d       d d d        t        j                  t        |      5  |j                  t        j                  g d      d       d d d        d}t        j                  t        |      5  |j                  t        j                  ddg             d d d        y # 1 sw Y   xY w# 1 sw Y   bxY w# 1 sw Y   y xY w)N)r    r!         @xxx)r   r#   r   r   rV   )r!   r    r   r   T
fill_valuer!   r    F
allow_fillr   zJWhen allow_fill=True and fill_value is not None, all indices must be >= -1r   r   r   r   r   3index -5 is out of bounds for (axis 0 with )?size 3r   r   )r   r&   r'   r   rX   rZ   r   r-   r   r   rr   
IndexError)r   r*   rj   ri   r/   s        r   test_take_fill_value_float64z%TestTake.test_take_fill_value_float64  s   O%rzzB"((:./

G
fh/ "((:.4@#sBFF+2::EJ
fh/ "((:.5TR

G
fh/ Y 	 ]]:S1 	<HHRXXj)dH;	<]]:S1 	<HHRXXj)dH;	< D]]:S1 	(HHRXXq"g&'	( 	(	< 	<	< 	<	( 	(s$   )H(*)H48'I (H14H= I	r#   c                 R   t        g d|d      }|j                  t        j                  g d            }t        g d|d      }t	        j
                  ||       t        |      j                  }d| d}t        j                  t        |      5  |j                  t        j                  g d      d	
       d d d        |j                  t        j                  g d      dd	      }t        g d|d      }t	        j
                  ||       t        j                  t        |      5  |j                  t        j                  g d      d	
       d d d        t        j                  t        |      5  |j                  t        j                  g d      d	
       d d d        d}t        j                  t        |      5  |j                  t        j                  ddg             d d d        y # 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   y xY w)Nr   r   r   r   )r   r   r2   zUnable to fill values because z cannot contain NAr   Tr   Fr   r   r   r   r   r   )r   r   r&   rX   rZ   r   r   rH   r   r   rr   r   )r   r#   r*   rj   ri   r   r/   s          r   test_take_fill_value_intsz"TestTake.test_take_fill_value_ints  s    IU7"((:./%e<
fh/Cy!!.tf4FG ]]:S1 	<HHRXXj)dH;	< "((:.5TR%e<
fh/]]:S1 	<HHRXXj)dH;	<]]:S1 	<HHRXXj)dH;	< D]]:S1 	(HHRXXq"g&'	( 	(	< 	<	< 	<	< 	<	( 	(s0   )G8.)H:)H'H8HHHH&N)rH   rI   rJ   r   rK   rL   r&   r'   rB   r   r   r   r   rM   r   r   r   r     sp    [[[2::rxx*KL( M(
(: [[Wrxx&;<( =(r   r   c                       e Zd Zej                  j                  dej                  ej                  ej                  g      d        Z
d Zd Zy)TestContainsr#   c                 .    t        g d|      }d |vsJ y )N)r   r   r   r2   rR   r"   )r   )r   r#   r   s      r   test_contains_nonezTestContains.test_contains_none  s     oU35   r   c                     t        ddt        j                  gt        j                        }t        j                  |v sJ y Nr    r!   r"   r   r&   r-   r'   r   s     r   test_contains_float64_nansz'TestContains.test_contains_float64_nans!  s-    sC(

;vvr   c                 h    t        ddt        j                  gt        j                        }d|v sJ y r  r  r   s     r   test_contains_float64_not_nansz+TestContains.test_contains_float64_not_nans%  s)    sC(

;e||r   N)rH   rI   rJ   r   rK   rL   r&   r'   rB   r   r  r  r  rM   r   r   r   r     sC    [[Wrzz288RYY&GH! I!
r   r   c                       e Zd Zej                  j                  deeg      d        Zej                  j                  deeg      d        Z	ej                  j                  deeg      d        Z
d Zd Zy)TestSliceLocsr#   c                    t        t        j                  g d|            }t        |      }|j	                  d      d|fk(  sJ |j	                  d      d|fk(  sJ |j	                  dd      dk(  sJ |j	                  dd	      d|fk(  sJ |j	                  d
      dk(  sJ |j	                  d
      dk(  sJ |d d d   }|j	                  dd      dk(  sJ |j	                  dd      dk(  sJ y )Nr   r   r   rS   rU   r   ru   rm   r"   r   startr2   rz   )r2   rU   rS   rm   end)r   rU   ru   )r   r   rV   r   rU   r   )r   rS   r   r&   rX   r   r.   r   r#   r   nr]   s        r   test_slice_locszTestSliceLocs.test_slice_locs+  s   bhh8FGJa(QF222a(QF2221%///2&1a&000A&&000A&&000 tt  A&&000  A&&000r   c                 .   t        t        j                  g d|            }t        |      }|j	                  dd      d|fk(  sJ |j	                  dd      dk(  sJ |d d d	   }|j	                  d
d      dk(  sJ |j	                  dd	      d|fk(  sJ y )Nr  r"   g      @g      $@r2   g      @g      %@)r2   rz   rV   ry   r%   r  r   r  r  s        r   test_slice_locs_float_locsz(TestSliceLocs.test_slice_locs_float_locs<  s    bhh8FGJT*q!f444T*f444tt  c*f444  r*q!f444r   c                    t        t        j                  g d|            }|j                  dd      dk(  sJ |j                  dd      dk(  sJ |d d d   }|j                  dd      dk(  sJ |j                  dd      dk(  sJ y )N)rm      r     r"   r  r   r2         rV   )r   r&   rX   r.   )r   r#   r   r]   s       r   test_slice_locs_dup_numericz)TestSliceLocs.test_slice_locs_dup_numericG  s    bhh/u=>B'6111B'6111tt  R(F222  R(F222r   c                 P   t        t        j                  ddg      }|j                  d      dk(  sJ |j                  t        j                        dk(  sJ t        dt        j                  t        j                  ddg      }|j                  t        j                        dk(  sJ y )Nr   r   r  )r   r2   r   )r   rS   )r   r&   r-   r.   r   s     r   test_slice_locs_naz TestSliceLocs.test_slice_locs_naQ  s    rvvq!n%"f,,,'6111q"&&"&&!Q/0'6111r   c                 H   t        t        j                  ddg      }d}t        j                  t
        |      5  |j                  d       d d d        t        j                  t
        |      5  |j                  d       d d d        y # 1 sw Y   @xY w# 1 sw Y   y xY w)Nr   r   z,non-monotonic index with a missing label 1.5r   r%   r  r  )r   r&   r-   r   r   r(   r.   )r   r   r/   s      r   test_slice_locs_na_raisesz'TestSliceLocs.test_slice_locs_na_raisesY  s    rvvq!n%<]]83/ 	(3'	( ]]83/ 	&%	& 	&	( 	(	& 	&s   B0BBB!N)rH   rI   rJ   r   rK   rL   intfloatr  r  r  r  r!  rM   r   r   r	  r	  *  s    [[WsEl31 41  [[WsEl35 45 [[WsEl33 432&r   r	  c                       e Zd Zej                  j                  dddg      d        Zej                  j                  dddg      ej                  j                  dd	d
g      d               Zy)TestGetSliceBoundszside, expected)r   rR   )r   rS   c                 `    t        t        d            }|j                  d|      }||k(  sJ y )NrU   rR   sider   r   get_slice_bound)r   r(  ri   r   rj   s        r   test_get_slice_bounds_withinz/TestGetSliceBounds.test_get_slice_bounds_withind  s2    eAh&&qt&4!!!r   r(  r   r   zbound, expected)rV   r   )rm   rU   c                 `    t        t        d            }|j                  ||      }||k(  sJ y )NrU   r'  r)  )r   r(  ri   boundr   rj   s         r   test_get_slice_bounds_outsidez0TestGetSliceBounds.test_get_slice_bounds_outsidej  s4     eAh&&u4&8!!!r   N)rH   rI   rJ   r   rK   rL   r+  r.  rM   r   r   r%  r%  c  sv    [[-\/JK" L"
 [[Vfg%67[[.'0BC" D 8"r   r%  )numpyr&   r   pandas.errorsr   pandasr   r   r   r   r   pandas._testing_testingrZ   pandas.core.arraysr	   r
   r   rO   r   r   r   r	  r%  rM   r   r   <module>r5     sq      +  M% M%`E: E:P
)0 )0X?( ?(D  6& 6&r" "r   