U
    >vfB                     @   s  d dl Z d dlmZm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)IndexSeries)is_bool_dtypez=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-vdrwu74i/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} t| js|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   r   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    r0   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    
r3   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_dtype]   s
    
r6   )r   Zpandasr   r   Zpandas._testingZ_testingr   Zpandas.api.typesr   markZparametrizer   r%   r&   r2   
ValueErrorr!   r*   r0   r3   r6   r   r   r   r   <module>   sF   $" 
	

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