a
    PfU	                     @   sB   d Z ddlZddlZddlmZmZ ddlmZ	 G dd dZ
dS )z[
Tests for DataFrame cumulative operations

See also
--------
tests.series.test_cumulative
    N)	DataFrameSeriesc                   @   s>   e Zd Zdd Zdd Zejdg ddd Zd	d
 Z	dS )TestDataFrameCumulativeOpsc                 C   sd   t dtditdd}|  |  |  t tdddtdtdd}|  d S )NA   )index      )r   columns)r   npZarangecummaxcummincumsumZreshaperange)selfdfdm r   [/var/www/ai-form-bot/venv/lib/python3.9/site-packages/pandas/tests/frame/test_cumulative.pytest_cumulative_ops_smoke   s    $z4TestDataFrameCumulativeOps.test_cumulative_ops_smokec                 C   s   t j|jdddf< t j|jdddf< t j|jdd df< |dt}|d |d |dt j}|d |d d S )Nr	   
   r            )r   nanilocZfillnaZastypeintcumprodZint32)r   datetime_framer   r   r   r   test_cumprod_smoke"   s    


z-TestDataFrameCumulativeOps.test_cumprod_smokemethod)r   r   r   r   c                 C   s   t j|jdddf< t j|jdddf< t j|jdd df< t|| }|tt|}t|| t||dd}|jtt|dd}t|| t |t |ksJ d S )Nr	   r   r   r   r   r   )Zaxis)	r   r   r   getattrapplyr   tmassert_frame_equalshape)r   r   r    resultexpectedr   r   r   &test_cumulative_ops_match_series_apply1   s    zATestDataFrameCumulativeOps.test_cumulative_ops_match_series_applyc                 C   sh   t g dg dg dd}| }t tg dtjdtg dtjd|d  d}t|| d S )N)r   r      )r   r   g      @)TFF)r   BC)r   r)      )Zdtyper+   )r   r   r   r   Zint64Zfloat64r#   r$   )r   r   r&   r'   r   r   r   test_cumsum_preserve_dtypesD   s    
z6TestDataFrameCumulativeOps.test_cumsum_preserve_dtypesN)
__name__
__module____qualname__r   r   pytestmarkZparametrizer(   r-   r   r   r   r   r      s
   
r   )__doc__numpyr   r1   Zpandasr   r   Zpandas._testingZ_testingr#   r   r   r   r   r   <module>   s
   