o
    5c9                     @   sF   d dl Zd dlZd dlmZmZ d dlmZ G dd dZ	dd Z
dS )    N)	DataFrameSeriesc                   @   s4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )
TestLookupc                    s   | t  jt j }t  jt j }tt  ||}W d    n1 s,w   Y  t	 fddt
||D }t|| d S )Nc                       g | ]\}} j ||f qS  loc.0rcdfr   ]/var/www/html/gps/gps/lib/python3.10/site-packages/pandas/tests/frame/indexing/test_lookup.py
<listcomp>       z0TestLookup.test_lookup_float.<locals>.<listcomp>)listindexlencolumnstmassert_produces_warningFutureWarninglookupnparrayzipassert_numpy_array_equal)selffloat_framerowscolsresultexpectedr   r   r   test_lookup_float   s   zTestLookup.test_lookup_floatc                    s   | t  jt j }t  jt j }tt  ||}W d    n1 s,w   Y  tj	 fddt
||D tjd}t|| d S )Nc                    r   r   r   r	   r   r   r   r      r   z0TestLookup.test_lookup_mixed.<locals>.<listcomp>)dtype)r   r   r   r   r   r   r   r   r   r   r   object_assert_almost_equal)r   float_string_framer    r!   r"   r#   r   r   r   test_lookup_mixed   s   zTestLookup.test_lookup_mixedc                    s   t g dg dg dg dd tt   jd d   d< W d    n1 s.w   Y  t fd	d
t jd d  D }t	 d t
|dd  d jtjks]J d S )N)abr*   r   )TTFT)TFFF)FTFT)labelmask_amask_bmask_cmask_r,   maskc                    r   r   r   r	   r   r   r   r   /   r   z/TestLookup.test_lookup_bool.<locals>.<listcomp>)name)r   r   r   r   r   r   r   r   r   assert_series_equalr   r%   bool_)r   exp_maskr   r   r   test_lookup_bool"   s    zTestLookup.test_lookup_boolc              	   C   sV  t jtdd% tt |dgdg W d    n1 s w   Y  W d    n1 s/w   Y  t jtdd( tt ||jd gdg W d    n1 sWw   Y  W d    n1 sfw   Y  t jtdd/ tt |g dd	g W d    n1 sw   Y  W d    d S W d    d S 1 sw   Y  d S )
Nz&'One or more row labels was not found'matchxyzAz)'One or more column labels was not found'r   z	same size)r*   r+   r   r*   )	pytestraisesKeyErrorr   r   r   r   r   
ValueError)r   r   r   r   r   test_lookup_raises5   s&   "zTestLookup.test_lookup_raisesc              	   C   s|  t tjdddddgd}ddg}ddg}tjtdd	# t	t
 ||| W d    n1 s6w   Y  W d    n1 sEw   Y  tjtdd	$ t	t
 |j|| W d    n1 siw   Y  W d    n1 sxw   Y  d|d
< tjtdd	, t	t
 ||| W d    n1 sw   Y  W d    d S W d    d S 1 sw   Y  d S )N         r:   )r   r      z!requires unique index and columnsr7   B)r   r   randomrandnreshaper;   r<   r>   r   r   r   r   T)r   r   r    r!   r   r   r    test_lookup_requires_unique_axesB   s.    "z+TestLookup.test_lookup_requires_unique_axesN)__name__
__module____qualname__r$   r)   r6   r?   rI   r   r   r   r   r      s    
r   c                  C   sd   t g dddtjdgg dd} tt | | j| d  W d    d S 1 s+w   Y  d S )N)r:   r:   rD   rD   P         )rM   7   L   C   )colr:   rD   rS   )r   r   nanr   r   r   r   r   r   r   r   r   test_lookup_deprecatedX   s   "rU   )numpyr   r;   pandasr   r   pandas._testing_testingr   r   rU   r   r   r   r   <module>   s    M