Ë
    u™ãjŒ  ã                   óR   — d Z ddlZddlZddlmZ ddlZddlm	Z
  G d„ d«      Zd„ Zy)z[
Tests for DataFrame cumulative operations

See also
--------
tests.series.test_cumulative
é    N)ÚOutOfBoundsTimedeltac                   ó´   — 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
d„ Zy)ÚTestDataFrameCumulativeOpsc                 óœ  — t        j                  dt        j                  d«      it        j                  d«      ¬«      }|j	                  «        |j                  «        |j                  «        t        j                  t        j                  d«      j                  dd«      t        d«      t        d«      ¬«      }|j                  «        y )NÚAé   )Úindexé   é   )r	   Úcolumns)	ÚpdÚ	DataFrameÚnpÚarangeÚcummaxÚcumminÚcumsumÚreshapeÚrange)ÚselfÚdfÚdms      úm/var/www/html/python-recuperauto-other/env/lib/python3.12/site-packages/pandas/tests/frame/test_cumulative.pyÚtest_cumulative_ops_smokez4TestDataFrameCumulativeOps.test_cumulative_ops_smoke   s{   € ä�\‰\˜3¤§	¡	¨"£Ð.´b·i±iÀ³mÔDˆØ
�	‰	ŒØ
�	‰	ŒØ
�	‰	Œä�\‰\œ"Ÿ)™) B›-×/Ñ/°°1Ó5¼UÀ1»XÌuÐUVËxÔXˆà
�	‰	�ó    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¾   € Ü')§v¡vˆ×Ñ˜A˜b˜D !˜GÑ$Ü(*¯©ˆ×Ñ˜B˜r˜E 1˜HÑ%Ü&(§f¡fˆ×Ñ˜B™C ˜FÑ#ð ×"Ñ" 1Ó%×,Ñ,¬SÓ1ˆØ
�
‰
�1ŒØ
�
‰
�1Œð ×"Ñ" 1Ó%×,Ñ,¬R¯X©XÓ6ˆØ
�
‰
�1ŒØ
�
‰
�1�r   c                 ól  — 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
        j                  |«      «      }t        j                  ||«        t        ||«      d¬«      }|j	                  t        t
        j                  |«      d¬«      }t        j                  ||«       t        j                  |«      t        j                  |«      k(  sJ ‚y )Nr   r   r   r   r   r    ©Úaxis)
r   r!   r"   ÚgetattrÚapplyr   ÚSeriesÚtmÚassert_frame_equalÚshape)r   r(   Úall_numeric_accumulationsÚresultÚexpecteds        r   Ú&test_cumulative_ops_match_series_applyzATestDataFrameCumulativeOps.test_cumulative_ops_match_series_apply0   s  € ô (*§v¡vˆ×Ñ˜A˜b˜D !˜GÑ$Ü(*¯©ˆ×Ñ˜B˜r˜E 1˜HÑ%Ü&(§f¡fˆ×Ñ˜B™C ˜FÑ#ð D”˜Ð)BÓCÓEˆØ!×'Ñ'¬´·	±	Ð;TÓ(UÓVˆÜ
×Ñ˜f hÔ/ð D”˜Ð)BÓCÈÔKˆØ!×'Ñ'Ü”B—I‘IÐ8Ó9Àð (ó 
ˆô 	×Ñ˜f hÔ/ô �x‰x˜Ó¤2§8¡8¨NÓ#;Ò;Ð;Ñ;r   c                 óv  — t        j                  g d¢g d¢g d¢dœ«      }|j                  «       }t        j                  t        j                  g d¢t        j
                  ¬«      t        j                  g d¢t        j                  ¬«      |d   j                  «       dœ«      }t        j                  ||«       y )N©r   r    é   )r   r    g      @©TFF)r   ÚBÚC)r   r9   é   ©Údtyper<   )	r   r   r   r/   r   Úint64Úfloat64r0   r1   ©r   r   r4   r5   s       r   Útest_cumsum_preserve_dtypesz6TestDataFrameCumulativeOps.test_cumsum_preserve_dtypesF   sz   € ä�\‰\¢	²ÒBVÑWÓXˆà—‘“ˆä—<‘<ä—Y‘Yšy´·±Ô9Ü—Y‘Yšy´·
±
Ô;Ø˜‘W—^‘^Ó%ñó
ˆô 	×Ñ˜f hÕ/r   Úmethod)r   r&   r   r   r,   r   r   c                 óp  — t        j                  g d¢g d¢g d¢g d¢t        j                  ddd«      t        j                  ddd«      t        j                  ddd«      gd	œ«      }|j                  d
dgd¬«      } t	        ||«      |d¬«      } t	        ||«      |«      }t        j                  ||«       y )Nr8   r:   )ÚaÚbÚc)g      ð?g      @g      @iâ  r   iã  iä  )r%   ÚboolÚstringÚfloatÚdatetimerJ   rL   r+   T)r,   Únumeric_only)r   r   Ú	TimestampÚdropr-   r0   r1   )r   rD   r,   r   Údf_numeric_onlyr4   r5   s          r   Útest_numeric_only_flagz1TestDataFrameCumulativeOps.test_numeric_only_flagU   s©   € ô �\‰\â Ú,Ú)Ú(ä—L‘L  q¨!Ó,Ü—L‘L  q¨!Ó,Ü—L‘L  q¨!Ó,ðñ
ó
ˆð Ÿ'™' 8¨ZÐ"8¸q˜'ÓAˆà$”˜˜VÓ$¨$¸TÔBˆØ3”7˜?¨FÓ3°DÓ9ˆÜ
×Ñ˜f hÕ/r   c                 óæ   — t        j                  d«       t        j                  dg d¢id¬«      }|j	                  «       }t        j                  dg d¢id¬«      }t        j                  ||«       y )NÚpyarrowrF   )g      Àg      Àg       Àzfloat64[pyarrow]r>   )ÚpytestÚimportorskipr   r   r   r0   r1   rB   s       r   Ú"test_cummax_pyarrow_float_negativez=TestDataFrameCumulativeOps.test_cummax_pyarrow_float_negativek   sY   € ä×Ñ˜IÔ&Ü�\‰\˜3Ò 2Ð3Ð;MÔNˆà—‘“ˆÜ—<‘< Ò&8Ð 9ÐASÔTˆÜ
×Ñ˜f hÕ/r   N)Ú__name__Ú
__module__Ú__qualname__r   r)   r6   rC   rT   ÚmarkÚparametrizerQ   rV   © r   r   r   r      s_   „ ò	òò<ò,0ð ‡[�[×Ñ˜XÒ'PÓQØ‡[�[×Ñ˜V a¨ VÓ,ñ0ó -ó Rð0ó(0r   r   c                  ó   — t        j                  t        j                  dd«      gdz  t         j                  j                  gdz  dœd¬«      } t	        j
                  t        d¬«      5  | j                  «        d d d «       y # 1 sw Y   y xY w)	Nr   ÚDr    )rF   rG   zm8[ns]r>   zoverflow in timedelta operation)Úmatch)r   r   Ú	TimedeltaÚmaxrT   Úraisesr   r   )r   s    r   Útest_td64_cumsum_overflowrc   u   sp   € ä	�‰Ü�|‰|˜A˜sÓ#Ð$ qÑ(´·±×0@Ñ0@Ð/AÀAÑ/EÑFØô
€Bô 
�‰Ô+Ð3TÔ	Uñ Ø
�	‰	Œ÷÷ ñ ús   Á*BÂB)Ú__doc__Únumpyr   rT   Úpandas.errorsr   Úpandasr   Úpandas._testingÚ_testingr0   r   rc   r\   r   r   ú<module>rj      s-   ðñó Û å .ã Ý ÷`0ñ `0óFr   