U
    f/e\                     @   s  d dl Z d dlmZ d dlmZ e jdddgddgdgd dgdgfddgddgdgddgdgfdddgdddgdgd ddgddgfdddgdddgdd ddgddgfdddgdddgdgd dgdgfdddgdddgdd dgdgfgd	d
 Ze jde	de
ddd edfe	de
ddd edfe	de
dddedfgdd Zdd Ze jddddgdddgge jdg dgdggdd Ze jdddddgddgfddddgddgfddgd dgddgfgdd  Zd!d" ZdS )#    N)Seriesz=data, index, drop_labels, axis, expected_data, expected_index      ZoneZtwoZrowsc           	      C   s6   t | |d}|j||d}t ||d}t|| d S )N)dataindexaxis)r   droptmassert_series_equal)	r   r   r   drop_labelsZexpected_dataexpected_indexsresultexpected r   I/tmp/pip-unpacked-wheel-tiezk1ph/pandas/tests/series/methods/test_drop.py%test_drop_unique_and_non_unique_index   s    r   z6data, index, drop_labels, axis, error_type, error_desc   abcbcnot found in axis)acolumnszNo axis named columnsc              	   C   s8   t | |d}tj||d |j||d W 5 Q R X d S )Nr   matchr   )r   pytestraisesr	   )r   r   r   r   Z
error_typeZ
error_descserr   r   r   test_drop_exception_raised   s    r    c                  C   s   t tdtdd} | jddd}t||  | jddgdd}| jd	d  }t|| t d
dgddgd} | j s|t	| d}t dgdgd}t|| d S )Nr   r   r   r   ignore)errorsr   dr   r   TF)
r   rangelistr	   r
   r   Zilocr   Z	is_objectAssertionError)r   r   r   r   r   r   test_drop_with_ignore_errors.   s    
r'   r   r   c                    s@    fdd| D }t | td }t |td}t|| d S )Nc                    s   g | ]}| kr|qS r   r   ).0ir   r   r   
<listcomp>C   s      z(test_drop_empty_list.<locals>.<listcomp>)r   dtype)r   objectr	   r
   r   )r   r   r   Zseriesr   r   r*   r   test_drop_empty_list?   s    r.   zdata, index, drop_labels   FTc              	   C   sF   | d krt nd }t| ||d}tjtdd || W 5 Q R X d S )N)r   r   r,   r   r   )r-   r   r   r   KeyErrorr	   )r   r   r   r,   r   r   r   r   test_drop_non_empty_listI   s    
r1   c               	   C   s\   t dddg} d}tjt|d | dd}W 5 Q R X t ddgddgd}t|| d S )Nr   r   r   zqIn a future version of pandas all arguments of Series\.drop except for the argument 'labels' will be keyword-onlyr   r   r   )r   r
   Zassert_produces_warningFutureWarningr	   r   )r   msgr   r   r   r   r   test_drop_pos_args_deprecationY   s    r4   )r   Zpandasr   Zpandas._testingZ_testingr
   markZparametrizer   r$   r%   r0   
ValueErrorr    r'   r.   r1   r4   r   r   r   r   <module>   sD   $" 




