o
    d                     @   s   d dl Zd dlZd dlZd dlmZ d dlmZ ej	
dddgdd Zej	
dd	d
gdd Zdd Zej	
dd	d
gdd Zdd Zdd Zej	
dejejgej	
ddd	ide igdd Zdd Zdd Zd d! ZdS )"    N)Serieszoperation, expected)mina)maxbc                 C   s,   t ddgdd}t||  }||ksJ d S )Nr   r   stringdtype)r   getattr)	operationexpectedserres_operation_serie r   h/var/www/html/visualizacion-main/env/lib/python3.10/site-packages/pandas/tests/series/test_reductions.pytest_reductions_series_strings	   s   r   	as_periodTFc                 C   s^   t dd tddD }| r|jd}n|jd}| }|j|jks'J t|| d S )Nc                 S   s   g | ]	}t d d|qS )i     )pd	Timestamp).0nr   r   r   
<listcomp>   s    z-test_mode_extension_dtype.<locals>.<listcomp>      Dz
US/Central)	r   rangedt	to_periodtz_localizemoder	   tmassert_series_equal)r   r   resr   r   r   test_mode_extension_dtype   s   r$   c                  C   sN   t dtjgdd} | d }|  |ksJ |  |ksJ |  |ks%J d S )Nr   zm8[ns]r   )r   r   NaTmedianr   r   )r   expr   r   r   test_reductions_td64_with_nat    s
   r(   skipnac                 C   s>   t g dd}|j| d}t|tjsJ |tdksJ d S )Nztimedelta64[ns]r   )r)   r   )r   sum
isinstancer   	Timedelta)r)   r   resultr   r   r   test_td64_sum_empty)   s   r.   c                  C   s(  t tjdddd} | d  td7  < | |    }tt| |   jt|  	 }t
|jd |jd s>J d}tjt|d	 | |   	  W d    n1 sZw   Y  | dd
 }tjt|d	 ||  	  W d    n1 sw   Y  | dd }||  	  d S )N20130101i H)periodsfreqr   z1s 1msi  zoverflow in timedelta operationmatchi'  )r   r   
date_ranger,   r   meanTimedeltaIndexasi8lenr*   npallclose_valuepytestraises
ValueError)r   r-   r   msgs1s2r   r   r   test_td64_summation_overflow3   s   &rC   c                  C   s.   t g dtdd} |  }t|t rJ d S )N)      ?rD   rD      )index)r   r   prodr+   )r   r-   r   r   r   test_prod_numpy16_bugL   s   rH   funckwargskeepdimsoutc                 C   st   t ddg}t| d }|j}d| d| d}tjt|d ||fi |  W d    d S 1 s3w   Y  d S )Nr      r   zthe 'z=' parameter is not supported in the pandas implementation of z\(\)r3   )r   list__name__r=   r>   r?   )rJ   rI   r   paramnamer@   r   r   r   )test_validate_any_all_out_keepdims_raisesS   s   "rR   c                  C   R   t ddg} d}tjt|d tj| dd W d    d S 1 s"w   Y  d S )Nr   rM   zPthe 'initial' parameter is not supported in the pandas implementation of sum\(\)r3   
   )initialr   r=   r>   r?   r:   r*   r   r@   r   r   r   test_validate_sum_initialc      "rX   c                  C   sP   t ddg} d}tjt|d | jdd W d    d S 1 s!w   Y  d S )Nr   rM   z[the 'overwrite_input' parameter is not supported in the pandas implementation of median\(\)r3   T)overwrite_input)r   r=   r>   r?   r&   rW   r   r   r   test_validate_median_initialn   s   "r[   c                  C   rS   )Nr   rM   zQthe 'keepdims' parameter is not supported in the pandas implementation of sum\(\)r3   T)rK   rV   rW   r   r   r   test_validate_stat_keepdims{   rY   r\   )numpyr:   r=   pandasr   r   pandas._testing_testingr!   markparametrizer   r$   r(   r.   rC   rH   anyallobjectrR   rX   r[   r\   r   r   r   r   <module>   s(    

	
	