U
    sVc                     @   s  d dl Z d dlmZ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#d$ ZdS )%    N)Index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serresultexpected r   I/tmp/pip-unpacked-wheel-xj8nt62q/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_descr   r   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 r|t	| jj
tkst	| 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dtypebool)r   r   r   r   r   r   test_drop_with_ignore_errors1   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>G   s      z(test_drop_empty_list.<locals>.<listcomp>)r   r'   )r   objectr
   r   r   )r   r   r   Zseriesr   r   r,   r   test_drop_empty_listC   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_listM   s    
r2   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_deprecation]   s    r5   c                 C   sZ   t dtdddg| dd}t|jd g}||}t dtdg| dd}t|| d S )Nd   r   r   )r'   r   )r   r   r   r
   r   r   )Zany_numeric_ea_dtypeZdfidxr   r   r   r   r   test_drop_index_ea_dtypej   s
    
r8   )r   Zpandasr   r   Zpandas._testingZ_testingr   markZparametrizer   r$   r%   r1   
ValueErrorr    r)   r/   r2   r5   r8   r   r   r   r   <module>   sF   $" 



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