Ë
    u™ãj*  ã                   óD   — d dl mZmZ d dlZd dlZd dlmZ  G d„ d«      Z	y)é    )ÚAnyÚfinalNc                   ó@  — e Zd ZdZdej
                  dedefd„Zdej
                  dedefd„Z	dedefd„Z
edej
                  dedefd	„«       Zej                  j                  dd
dg«      d„ «       Zej                  j#                  d«      ej                  j                  dd
dg«      d„ «       «       Zej                  j                  dd
dg«      d„ «       Zej                  j#                  d«      ej                  j                  dd
dg«      defd„«       «       Zy)ÚBaseReduceTestszg
    Reduction specific tests. Generally these only
    make sense for numeric/boolean operations.
    ÚserÚop_nameÚreturnc                 ó   — |dk(  S )NÚcount© )Úselfr   r   s      úm/var/www/html/python-recuperauto-other/env/lib/python3.12/site-packages/pandas/tests/extension/base/reduce.pyÚ_supports_reductionz#BaseReduceTests._supports_reduction   s   € à˜'Ñ!Ð!ó    Úskipnac                 ó$  — t        ||«      }	 |j                  d«      }t        ||«      }|dk(  r |«       } |«       }n ||¬«      } ||¬«      }t        j                  ||«       y # t        t        f$ r |j                  t        «      }Y Œow xY w)NÚfloat64r   ©r   )ÚgetattrÚastypeÚ	TypeErrorÚ
ValueErrorÚobjectÚtmÚassert_almost_equal)	r   r   r   r   Úres_opÚaltÚexp_opÚresultÚexpecteds	            r   Úcheck_reducezBaseReduceTests.check_reduce   s‘   € ô ˜˜gÓ&ˆð	%Ø—*‘*˜YÓ'ˆCô ˜˜gÓ&ˆØ�gÒÙ“XˆFÙ“x‰Há 6Ô*ˆFÙ VÔ,ˆHÜ
×Ñ˜v xÕ0øô œ:Ð&ò 	%ð —*‘*œVÓ$ŠCð		%ús   ŽA( Á($BÂBc                 ó   — |j                   S )N©Údtype)r   Úarrr   r   s       r   Ú_get_expected_reduction_dtypez-BaseReduceTests._get_expected_reduction_dtype-   s   € ð �y‰yÐr   c                 ó@  — |j                   }t        j                  d|i«      }|dv rddini }| j                  |||«      } |j                  |f|ddœ|¤Ž} t        ||«      d	d|i|¤Žj                   }	t        j                  ||	«       |sE|j                  «       j                  «       r't        j                   t        j                  g|¬«      }
n7 t        |j                  «       |«      «       }t        j                   |g|¬«      }
t        j                  ||
«       y )
NÚa)ÚvarÚstdÚsemÚddofé   T)r   Úkeepdimsr   r#   r   )ÚarrayÚpdÚ	DataFramer&   Ú_reducer   r   Úassert_extension_array_equalÚisnaÚanyÚNAÚdropna)r   r   r   r   r%   ÚdfÚkwargsÚ	cmp_dtypeÚresult1Úresult2r    Ú	exp_values               r   Úcheck_reduce_framez"BaseReduceTests.check_reduce_frame7   sø   € ð �i‰iˆÜ�\‰\˜3 ˜*Ó%ˆà 'Ð+@Ñ @�&˜!‘Àbˆà×6Ñ6°s¸GÀVÓLˆ	ð �#—+‘+˜gÐN¨f¸tÑNÀvÑNˆØ&”'˜"˜gÓ&Ñ?¨fÐ?¸Ñ?×EÑEˆÜ
×'Ñ'¨°Ô9ñ ˜#Ÿ(™(›*Ÿ.™.Ô*Ü—x‘x¤§¡ ¨yÔ9‰Hà6œ §
¡
£¨gÓ6Ó8ˆIÜ—x‘x  °9Ô=ˆHä
×'Ñ'¨°Õ:r   TFc                 ó*  — |}t        j                  |«      }| j                  ||«      sKdj                  g d¢«      }t	        j
                  t        |¬«      5   t        ||«      |¬«       d d d «       y | j                  |||«       y # 1 sw Y   y xY w)Nú|)ú[Cc]annot performúdoes not support operationúis not supported©Úmatchr   ©	r0   ÚSeriesr   ÚjoinÚpytestÚraisesr   r   r!   )r   ÚdataÚall_boolean_reductionsr   r   r   Úmsgs          r   Útest_reduce_series_booleanz*BaseReduceTests.test_reduce_series_booleanR   s†   € à(ˆÜ�i‰i˜‹oˆà×'Ñ'¨¨WÔ5Ø—(‘(òóˆCô —‘œy°Ô4ñ 5Ø%”˜˜WÓ%¨VÕ4÷5ð 5ð ×Ñ˜c 7¨FÕ3÷	5ð 5úó   ÁB	Â	Bzignore::RuntimeWarningc                 ó*  — |}t        j                  |«      }| j                  ||«      sKdj                  g d¢«      }t	        j
                  t        |¬«      5   t        ||«      |¬«       d d d «       y | j                  |||«       y # 1 sw Y   y xY w)Nr@   )	rA   zdoes not supportz(Categorical is not ordered for operationzis not implemented forz:complex\(\) (first )?argument must be a string or a numberz"can't multiply sequence by non-intú(setting an array element with a sequencezCannot convert .* to numericzCould not convert .* to numericrD   r   rF   )r   rK   Úall_numeric_reductionsr   r   r   rM   s          r   Útest_reduce_series_numericz*BaseReduceTests.test_reduce_series_numericf   sˆ   € ð )ˆÜ�i‰i˜‹oˆà×'Ñ'¨¨WÔ5Ø—(‘(ò
óˆCô —‘œy°Ô4ñ 5Ø%”˜˜WÓ%¨VÕ4÷5ð 5ð
 ×Ñ˜c 7¨FÕ3÷5ð 5úrO   c                 óè   — |}t        j                  |«      }|dk(  rt        j                  |› d�«       | j	                  ||«      st        j                  d|› d�«       | j                  |||«       y )Nr   z not an array methodz
Reduction z not supported for this dtype)r0   rG   rI   Úskipr   r>   )r   rK   rR   r   r   r   s         r   Útest_reduce_framez!BaseReduceTests.test_reduce_frame‚   sh   € à(ˆÜ�i‰i˜‹oˆà�gÒÜ�K‰K˜7˜)Ð#7Ð8Ô9à×'Ñ'¨¨WÔ5Ü�K‰K˜* W IÐ-JÐKÔLà×Ñ  W¨fÕ5r   c                 ó  — |}t        j                  |«      }i }|dk7  r||d<   |g}|dv r$|j                  i |¥dt        |«      dz   i¥«       n|dv r|j                  i |¥ddi¥«       | j	                  ||«      srd	j                  d
|› d�dd|› d�d|› d�ddd|› �ddddg«      }	t        j                  t        t        f|	¬«      5   t        |j                  |«      di |¤Ž d d d «       y 	 t        |j                  |«      }
|D ]=  } |j                  j                  |fi |¤Ž} 
di |¤Ž}t        j                  ||«       Œ? y # 1 sw Y   y xY w# t        $ r"}t        j                  d|› �«       Y d }~Œud }~ww xY w)Nr   r   )ÚsumÚprodÚ	min_countr-   )r*   r)   r+   r,   r   r@   zobject has no attribute 'ú'rB   rC   z is not implemented forzCannot perform reduction 'z[Cc]ould not convertzCannot convertz)Categorical is not ordered for operation rQ   z*can't multiply sequence by non-int of typez7complex\(\) first argument must be a string or a numberz1complex\(\) argument must be a string or a numberrD   zYIn a future version of pandas reductions will be implemented throughdedicated functions: r   )r0   rG   ÚappendÚlenr   rH   rI   rJ   r   ÚAttributeErrorr   r/   rU   r2   r   r   )r   ÚrequestrK   Úall_reductionsr   r   r   r9   ÚvariantsrM   r   ÚeÚcall_kwargsr    r   s                  r   Útest_reduce_arrayz!BaseReduceTests.test_reduce_array�   s»  € ð !ˆÜ�i‰i˜‹oˆà!#ˆØ�gÒØ%ˆF�8Ñð �8ˆØ�oÑ%Ø�O‰OÐA˜vÐA {´C¸³H¸q±LÑAÕBØÐ-Ñ-Ø�O‰OÐ1˜vÐ1 v¨qÑ1Ô2à×'Ñ'¨¨WÔ5à—(‘(à/°¨y¸Ð:Ø0Ø&Ø�iÐ6Ð7Ø0°°	¸Ð;Ø*Ø$Ø?À¸yÐIØ>Ø@ØNØHðóˆCô  —‘¤	¬>Ð:À#ÔFñ 6Ø+”˜Ÿ	™	 7Ó+Ñ5¨fÒ5÷6àð	Ü˜SŸY™Y¨Ó0ˆFð $ò 	5ˆKØ(�s—y‘y×(Ñ(¨Ñ@°KÑ@ˆHÙÑ*˜kÑ*ˆFÜ×"Ñ" 6¨8Õ4ñ	5÷6àûô
 ò 	Ü�K‰Kð(Ø() sð,÷ñ ûð	ús$   ÃEÃ/E ÅEÅ	E?ÅE:Å:E?N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r0   rG   ÚstrÚboolr   r!   r&   r   r>   rI   ÚmarkÚparametrizerN   ÚfilterwarningsrS   rV   rd   r   r   r   r   r      s^  „ ñð
" r§y¡yð "¸3ð "À4ó "ð1 §	¡	ð 1°Cð 1Àó 1ð.¸#ð Àtó ð ð; b§i¡ið ;¸#ð ;Àtò ;ó ð;ð4 ‡[�[×Ñ˜X¨¨e }Ó5ñ4ó 6ð4ð& ‡[�[×ÑÐ 8Ó9Ø‡[�[×Ñ˜X¨¨e }Ó5ñ4ó 6ó :ð4ð4 ‡[�[×Ñ˜X¨¨e }Ó5ñ
6ó 6ð
6ð ‡[�[×ÑÐ 8Ó9Ø‡[�[×Ñ˜X¨¨e }Ó5ð25Àtò 25ó 6ó :ñ25r   r   )
Útypingr   r   rI   Úpandasr0   Úpandas._testingÚ_testingr   r   r   r   r   ú<module>rr      s!   ð÷ó
 ã Ý ÷w5ò w5r   