o
    Û­jU	  ã                   @   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   ÚnpÚarangeÚcummaxÚcumminÚcumsumÚreshapeÚrange)ÚselfÚdfÚdm© r   ú_/var/www/html/CropPilot/venv/lib/python3.10/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ÚilocÚfillnaÚastypeÚintÚcumprodÚ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sVJ ‚d S )Nr	   r   r   r   r   r   )Ú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/   é   )Údtyper1   )r   r   r   r   Úint64Ú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ÚmarkÚparametrizer.   r6   r   r   r   r   r      s    
r   )Ú__doc__Únumpyr   r:   Úpandasr   r   Úpandas._testingÚ_testingr)   r   r   r   r   r   Ú<module>   s    