
    Pi                     T    d Z ddlZddlZddlmZmZmZ ddlm	Z
  G d d          ZdS )z[
Tests for DataFrame cumulative operations

See also
--------
tests.series.test_cumulative
    N)	DataFrameSeries	Timestampc                       e Zd Zd Zd Zd Zd Zej        	                    dg d          ej        	                    ddd	g          d
                         Z
dS )TestDataFrameCumulativeOpsc                    t          dt          j        d          it          j        d                    }|                                 |                                 |                                 t          t          j        d                              dd          t          d          t          d                    }|                                 d S )NA   )index      )r   columns)r   nparangecummaxcummincumsumreshaperange)selfdfdms      v/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/pandas/tests/frame/test_cumulative.pytest_cumulative_ops_smokez4TestDataFrameCumulativeOps.test_cumulative_ops_smoke   s    RYr]]+29R==AAA
		
		
		ry}},,Q22%((ERSHHUUU
		    c                    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   s      r   test_cumprod_smokez-TestDataFrameCumulativeOps.test_cumprod_smoke#   s    ')vAbD!G$(*BrE1H%&(fBCCF# ""1%%,,S11


1


1 ""1%%,,RX66


1


1r   c                 J   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          j        ||            t          ||          d          }|                    t          t
          |          d          }t          j        ||           t          j        |          t          j        |          k    sJ d S )Nr   r   r   r   r   r    axis)	r   r!   r"   getattrapplyr   tmassert_frame_equalshape)r   r(   all_numeric_accumulationsresultexpecteds        r   &test_cumulative_ops_match_series_applyzATestDataFrameCumulativeOps.test_cumulative_ops_match_series_apply2   s!    (*vAbD!G$(*BrE1H%&(fBCCF# D)BCCEE!''8Q(R(RSS
fh/// D)BCCKKK!''F566Q ( 
 
 	fh/// x28N#;#;;;;;;;r   c                 L   t          g dg dg dd          }|                                }t          t          g dt          j                  t          g dt          j                  |d                                         d          }t          j        ||           d S )Nr   r       )r   r    g      @TFF)r	   BC)r   r8      )dtyper;   )r   r   r   r   int64float64r/   r0   )r   r   r3   r4   s       r   test_cumsum_preserve_dtypesz6TestDataFrameCumulativeOps.test_cumsum_preserve_dtypesH   s    YYY[[[?S?S?STTUUIIIRX666IIIRZ888W^^%% 
 
 	fh/////r   method)r   r&   r   r   r,   r   r   c                 d   t          g dg dg dg dt          ddd          t          ddd          t          ddd          gd	          }|                    d
dgd          } t          ||          |d          } t          ||          |          }t	          j        ||           d S )Nr7   r9   )abc)g      ?g      @g      @i  r   i  i  )r%   boolstringfloatdatetimerG   rI   r+   T)r,   numeric_only)r   r   dropr-   r/   r0   )r   rA   r,   r   df_numeric_onlyr3   r4   s          r   test_numeric_only_flagz1TestDataFrameCumulativeOps.test_numeric_only_flagW   s      yy,,,)//(dAq))dAq))dAq))
 

 
 ''8Z"8q'AA$V$$$TBBB37?F33D99
fh/////r   N)__name__
__module____qualname__r   r)   r5   r@   pytestmarkparametrizerM    r   r   r   r      s        	 	 	  < < <,0 0 0 [X'P'P'PQQ[VaV,,0 0 -, RQ0 0 0r   r   )__doc__numpyr   rQ   pandasr   r   r   pandas._testing_testingr/   r   rT   r   r   <module>rZ      s                  
      W0 W0 W0 W0 W0 W0 W0 W0 W0 W0r   