o
    թZh                     @   s&   d dl Z d dlmZ G dd dZdS )    Nc                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
TestDataFrameTakec                 C   s   |}t ddd}tt |j|dd W d    n1 sw   Y  tt |j|dd W d    d S 1 s<w   Y  d S )Nr         Zaxis)slicetmZassert_produces_warningFutureWarningtake)selffloat_framedfZslc r   \/var/www/html/lang_env/lib/python3.10/site-packages/pandas/tests/frame/indexing/test_take.pytest_take_slices_deprecated   s   "z-TestDataFrameTake.test_take_slices_deprecatedc                 C   s  g d}|fD ]2}|j |dd}||j |}t|| |j |dd}|jd d g df }tj||dd qg d}|fD ]?}|j |dd}||j |}t|| |j |dd}t|| |j |dd}|jd d g d	f }tj||dd qAd
}tjt|d |j g ddd W d    n1 sw   Y  tjt|d |j g ddd W d    n1 sw   Y  tjt|d |j g ddd W d    n1 sw   Y  tjt|d |j g ddd W d    d S 1 sw   Y  d S )N)   r      r   r   r   r   )DBCAF)Zcheck_names)r   r   )r   r   r   zindices are out-of-bounds)match)r   r   r      )r   r   r   i)r   r   r      )r   r   r   )	r	   reindexindexr   assert_frame_equallocpytestZraises
IndexError)r
   r   orderr   resultexpectedmsgr   r   r   	test_take   s>   

"zTestDataFrameTake.test_takec                 C   s   g d}|fD ]0}|j |dd}||j |}t|| |j |dd}|jd d g df }t|| qg d}|fD ]0}|j |dd}||j |}t|| |j |dd}|jd d g df }t|| q?d S )N)r   r   r   r   r   r   r   r   )foor   r   r   r   )r   r   )r&   r   r   r	   r   r   r   r   r   )r
   Zfloat_string_framer!   r   r"   r#   r   r   r   test_take_mixed_type8   s"   

z&TestDataFrameTake.test_take_mixed_typec                 C   sv   g d}||fD ]0}|j |dd}||j |}t|| |j |dd}|jd d g df }t|| qd S )N)r   r   r   r   r   r   r   )r   r   r   r   r(   )r
   Zmixed_float_frameZmixed_int_framer!   r   r"   r#   r   r   r   test_take_mixed_numericQ   s   z)TestDataFrameTake.test_take_mixed_numericN)__name__
__module____qualname__r   r%   r)   r*   r   r   r   r   r      s
    
'r   )r   Zpandas._testingZ_testingr   r   r   r   r   r   <module>   s    