
    .i                     L    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y)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                  j                  dg d      ej                  j                  ddd	g      d
               Z
y)TestDataFrameCumulativeOpsc                 t   t        dt        j                  d      it        j                  d            }|j                          |j	                          |j                          t        t        j                  d      j                  dd      t        d      t        d            }|j                          y )NA   )index      )r   columns)r   nparangecummaxcummincumsumreshaperange)selfdfdms      `/var/www/app/trading-bot/venv/lib/python3.12/site-packages/pandas/tests/frame/test_cumulative.pytest_cumulative_ops_smokez4TestDataFrameCumulativeOps.test_cumulative_ops_smoke   ss    RYYr]+299R=A
		
		
		ryy},,Q2%(ERSHU
		    c                    t         j                  |j                  dddf<   t         j                  |j                  dddf<   t         j                  |j                  dd df<   |j                  d      j	                  t
              }|j                  d       |j                  d       |j                  d      j	                  t         j                        }|j                  d       |j                  d       y )Nr   
   r            )r   nanilocfillnaastypeintcumprodint32)r   datetime_framer   s      r   test_cumprod_smokez-TestDataFrameCumulativeOps.test_cumprod_smoke#   s    ')vvAbD!G$(*BrE1H%&(ffBCF# ""1%,,S1


1


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


1


1r   c                 D   t         j                  |j                  dddf<   t         j                  |j                  dddf<   t         j                  |j                  dd df<    t        ||             }|j	                  t        t
        |            }t        j                  ||        t        ||      d      }|j	                  t        t
        |      d      }t        j                  ||       t        j                  |      t        j                  |      k(  sJ y )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     (*vvAbD!G$(*BrE1H%&(ffBCF# D)BCE!''8Q(RS
fh/ D)BCK!''F56Q ( 
 	fh/ xx288N#;;;;r   c                 &   t        g dg dg dd      }|j                         }t        t        g dt        j                        t        g dt        j
                        |d   j                         d      }t        j                  ||       y )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   sj    Y[?STUIRXX6IRZZ8W^^%
 	fh/r   method)r   r&   r   r   r,   r   r   c                     t        g dg dg dg dt        ddd      t        ddd      t        ddd      gd	      }|j                  d
dgd      } t        ||      |d      } t        ||      |      }t	        j
                  ||       y )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      ,)(dAq)dAq)dAq)

 ''8Z"8q'A$V$$TB37?F3D9
fh/r   N)__name__
__module____qualname__r   r)   r5   r@   pytestmarkparametrizerM    r   r   r   r      sZ    	<,0 [[X'PQ[[VaV,0 - R0r   r   )__doc__numpyr   rQ   pandasr   r   r   pandas._testing_testingr/   r   rT   r   r   <module>rZ      s-      
 W0 W0r   