403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/site-packages/pandas/tests/groupby/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/pandas/tests/groupby/__pycache__/test_numeric_only.cpython-312.pyc
�

/	�g�H��0�ddlZddlZddlZddlmZddlZddlmZm	Z	m
Z
mZmZddl
mZddlmZGd�d�Zej&j)dgd��d	��Zej&j)d
gd��ej&j)ddd
ej,g�ej&j)ddgddgg�d����Zej&j1d�ej&j)deeeeg�d���Zy)�N)�lib)�	DataFrame�Index�Series�	Timestamp�
date_range)�get_groupby_method_argsc���eZdZejd��Zejjdddg�d��Zejjdddg�d��Z	ejjdd	d
g�d��Z
ejjddd
g�d��Zejjdddg�d��Zejjdddg�d��Z
d�Zy)�TestNumericOnlyc��tgd�gd�gd�td�ttd��jd�gd�t	dd�	�t	ddd
��tjddd
��d�	gd���}|S)N)�r
�)r
r�)g@g@�@�abc�category)���	�20130101r)�periods�
US/Eastern)r�tzz1 s�s)r�freq)	�group�int�float�string�category_string�category_int�datetime�
datetimetz�	timedelta��columns)r�listr�astyper�pd�timedelta_range)�self�dfs  �HC:\Python312\Lib\site-packages\pandas/tests/groupby/test_numeric_only.pyr,zTestNumericOnly.dfsq���"� �(��u�+�#)�$�u�+�#6�#=�#=�j�#I� )�&�z�1�=�(��Q�<�P��/�/��q�s�K�

�
�
��0�	��method�mean�medianc���tgd��}|jd�}tddgddgtjd�tjd�gd	d
gtd�td�gtdd
��tdd
��gd�tddgd��gd���}t
||�d��}tj|j|�|�|j}|j||||�y)N�rrr!rg@rg@rz1.5s�3sg�?rz2013-01-01 12:00:00z2013-01-03 00:00:00r)r)r!rr$rr"r#r
r)�name)�indexr&T��numeric_only)r�groupbyrr)�	Timedeltar�getattr�tm�assert_frame_equal�reindex_liker&�_check)r+r,r/�expected_columns_numeric�gb�expected�result�expected_columnss        r-�
test_averageszTestNumericOnly.test_averages5s���$)�)I�#J� �
�Z�Z��
 ���!$�a���s�� �l�l�6�2�B�L�L��4F�G��Q�x��3�4��3�4��
�3��E��3��E��

���A��W�-��!
��.%���V�$�$�7��
���f�1�1�(�;�X�F�#�+�+�����B�� 0�2J�Kr.�min�maxc�J�tgd��}|}|j||||�y)N)rrrr!r"r#r$�rr?�r+r,r/rDr@s     r-�test_extremazTestNumericOnly.test_extremaYs0��
!�
�

��$4� ����B�� 0�2J�Kr.�first�lastc�J�tgd��}|}|j||||�y)N)rrrr r!r"r#r$rIrJs     r-�test_first_lastzTestNumericOnly.test_first_lastms.�� �	
�
��$4� ����B�� 0�2J�Kr.�sum�cumsumc��tgd��}tgd��}|dk(r
tgd��}|j||||�y)Nr3)rrrr!r$rQ)rrr!r$rI)r+r,r/r@rDs     r-�test_sum_cumsumzTestNumericOnly.test_sum_cumsumsF��#(�)I�#J� � �C�
���X��$�%R�S�����B�� 0�2J�Kr.�prod�cumprodc�J�tgd��}|}|j||||�y)Nr3rIrJs     r-�test_prod_cumprodz!TestNumericOnly.test_prod_cumprod�s(�� �!A�B��#3� ����B�� 0�2J�Kr.�cummin�cummaxc�J�tgd��}|}|j||||�y)N)rrr!r"r#r$rIrJs     r-�test_cummin_cummaxz"TestNumericOnly.test_cummin_cummax�s.��!�S�
��
$4� ����B�� 0�2J�Kr.c�.�|jd�}|jd�rtnt}|dvrbdj	dd|�d�tjd|�d	��d
g�}tj||��5t||��ddd�n�|dvrtdj	d
tjd|�d	��tjd|�d��g�}tj||��5t||��ddd�n1t||��}tj|j|�|dvr}dj	ddd
d|�d�tjd|�d	��tjd|�d��g�}tj||��5t||�d��ddd�yt||�d��}tj|j|�y#1swY��xYw#1swY��xYw#1swYyxYw)Nr�cum)rFrGrXrYrQrU�|zCategorical is not orderedzCannot perform z with non-ordered Categorical�agg function failed [how->�,dtype->object]�*function is not implemented for this dtype��match)rPr0r1rTz-category type does not support sum operationsz,dtype->string]�rLrMzcategory type does not supportFr7)
r9�
startswith�NotImplementedError�	TypeError�join�re�escape�pytest�raisesr;r<�assert_index_equalr&)	r+r,r/rDr@rA�	exception�msgrCs	         r-r?zTestNumericOnly._check�s��
�Z�Z��
 ��,2�+<�+<�U�+C�'��	��L�L��(�(�0�%�f�X�-J�K��I�I� :�6�(�/�R�S�@���C����y��4�
&�#���F�#�%�
&�
&�
�8�
8��(�(�C��I�I� :�6�(�/�R�S��I�I� :�6�(�/�R�S���C����y��4�
&�#���F�#�%�
&�
&�)�W�R��(�*�F��!�!�&�.�.�2J�K��*�*��(�(�0�4�@�%�f�X�-J�K��I�I� :�6�(�/�R�S��I�I� :�6�(�/�R�S�
�	�C����y��4�
8�#���F�#��7�
8�
8�)�W�R��(�e�<�F��!�!�&�.�.�2B�C�?
&�
&��
&�
&��"
8�
8�s$�:G3�2G?�"H�3G<�?H�HN)�__name__�
__module__�__qualname__rk�fixturer,�mark�parametrizerErKrOrSrWr[r?�r.r-rrs(���^�^����:�[�[���X���'9�:�!L�;�!L�F�[�[���X��u�~�6�L�7�L�&�[�[���X���'8�9�L�:�L�"�[�[���X��x�'8�9�	L�:�	L��[�[���X��	�':�;�L�<�L��[�[���X��(�';�<�	L�=�	L�1Dr.rr8)TFNc�0�|dvrtjd�|dvr1d}|jtjj	|���ttjjd�jd�gd��	�}d
|d<gd�}|j|�}t||�}t||�}	d
di}
|�||
d<d}d}d|�d�}
|��||vr�d}|dvrQtjt|��5tj t"|
��5||	i|
��ddd�ddd�ytjt|��5||	i|
��ddd�y||vr/d}tjt|��5||	i|
��ddd�y|�|s�|dvr�d}|r!ddl}t|j&j(f}nt}tj|ddj+|��d���5tj t"|
��5||	i|
��ddd�ddd�ytj t"|
��5||	i|
��}ddd�|r|j-d�	�j.n|j.}t||�|	�j.}|dk(r|s|j1t2�}tj4|�y#1swY���xYw#1swYyxYw#1swYyxYw#1swYyxYw#1swY��xYw#1swYyxYw#1swY��xYw)N)�idxmax�idxminz5idxmax and idx_min tested in test_idxmin_idxmax_axis1)�corrwith�skewzDGH#47723 groupby.corrwith and skew do not correctly implement axis=1)�reasonr)�
�)�A�B�C�Dr%�x�E)
r
rrr
rrr
rrr~�axisr
r8)rUrQ�diff�fillna�
pct_change�rank�shift)rUrQr�r�r�r�rYrXryrxr�zDataFrameGroupBy.z with axis=1 is deprecated�1got an unexpected keyword argument 'numeric_only')rUrQrbz)got an unexpected keyword argument 'axis')r�r�)z"not supported between instances ofz2can't multiply sequence by non-int of type 'float'�unsupported operand typez
has no kernelr�(r^�)r�)rk�skip�applymarkerrt�xfailr�np�random�default_rng�standard_normalr9r;r	rlrgr<�assert_produces_warning�
FutureWarning�pyarrowr�ArrowNotImplementedErrorrh�drop�Tr(r�assert_equal)�request�groupby_funcr8�using_infer_stringror,�groupsrAr/�args�kwargs�no_args�has_axis�warn_msg�msgs�pa�errsrC�df_expectedrBs                    r-�test_axis1_numeric_onlyr��s���+�+����K�L��+�+�T�����F�K�K�-�-�S�-�9�:�	�
�	�	���a� �0�0��9�CW�
�B��B�s�G�
+�F�	���F�	�B�
�R��
&�F�"�<��4�D��a�[�F���!-��~��U�G��H�#�<�.�0J�K�H���L�G�$;�A���0�0����y��4�
,��/�/�
�X�N�,��D�+�F�+�,�
,�
,����y��4�
(���'��'�
(�
(�	�X�	%�9��
�]�]�9�C�
0�	$��D�#�F�#�	$�	$��
�l��M�9�
��� ��r�v�v�>�>�?�D��D�
�]�]�4��3�8�8�D�>�*:�!�'<�
=�	(��+�+�M��J�
(���'��'�
(�	(�	(��
'�
'�
�X�
F�	-��T�,�V�,�F�	-�1=�b�g�g�c�g�*�,�,�"�$�$��5�7�;��5�t�<�>�>���7�"�<� ���u�-�H�
�����)�W,�,��
,�
,��
(�
(��	$�	$��.
(�
(��	(�	(��	-�	-�sl�8K�	K�K�		K�<	K(�+L�	K4�L�<	L�K
	�K�K�K%�(K1�4K=	�9L�L	�Lzkernel, has_arg))�allF)�anyF)�bfillF)�corrT)rzT)�covT)rYT)rXT)rUT)rQT)r�F)�ffillF)r�F)rLT)rxT)ryT)rMT)rGT)r0T)r1T)rFT)�nthF)�nuniqueF)r�F)rTT)�quantileT)�semT)r{T)�stdT)rPT)�varTTF�keys�a1�a2c�J�tddgddgddgdtgzd��}t||�}|tjurind|i}|j|�}t
||�}|r|dur||i|��}	d|	jvsJ�y|d	vs|d
vrZ|tjurH|dk(rtnd}
d}tj|
|�
�5||i|��}	ddd�d	jvsJ�y|r�|dusJ�|jd�rtnt}djdddddtj d|�d��g�}|dk(rd}n|dk(rd}t#j$||�
�5||i|��ddd�y|s?|tjur-t#j$td�
�5||i|��ddd�y|dvsJ�|tjusJ�t#j$td�
�5||i|��ddd�y#1swY��.xYw#1swYyxYw#1swYyxYw#1swYyxYw)Nr
r��)r�r��a3�br8Tr�rd)r�r�r�r�r�r�r�r��%DataFrameGroupBy.fillna is deprecatedrbr]r^znot allowed for this dtype�+cannot be performed against 'object' dtypeszmust be a string or a.* numberr�rar_r`ryz8'<' not supported between instances of 'type' and 'type'rxz8'>' not supported between instances of 'type' and 'type'r�)r�r�)r�objectr	r�
no_defaultr9r;r&r�r<r�rerfrgrhrirjrkrl)
�kernel�has_argr8r�r,r�r�rAr/rC�warnrorns
             r-�test_numeric_onlyr�*sc��T
�1�a�&��A��q�!�f�1��x�<�P�	Q�B�"�6�2�.�D��3�>�>�1�R���7U�F�	���D�	�B�
�R��
 �F��<�4�'���(��(���&�.�.�(�(�(�	�#�#�
�R�R�����.�!'�(� 2�}���5��
�
'�
'��C�
8�	-��T�,�V�,�F�	-��f�n�n�$�$�$�	��4�'�'�'�
,2�+<�+<�U�+C�'��	��h�h�,�=�0�*�<��	�	�6�v�h�o�N�O�
�

���X��L�C�
�x�
�L�C�
�]�]�9�C�
0�	$��D�#�F�#�	$�	$�
��S�^�^�;�
�]�]��P�
�	$�
�D�#�F�#�	$�	$�
�/�/�/�/��s�~�~�-�-�-�
�]�]�9�,G�
H�	$��D�#�F�#�	$�	$�K	-�	-��4	$�	$��	$�	$��	$�	$�s0�?	G4�	H�	H
�"	H�4G>�H
�
H�H"z4ignore:Downcasting object dtype arrays:FutureWarning�dtypec��gd�}tgd�|��}|j|�}|dk(rt||�rJ�yt||�}tgd��}|j|�}t||�}	t	||�}
d}d}||vrk|t
urc|dk(rd}
nd	}
|d
k(rtnd}d}tj||��5tjt|
��5||
�ddd�ddd�n�|t
ur�|d
k(rtnd}d
}tj||��5||
�}ddd�tj||��5|	|
�}ddd�||vrjt
�}tj�d}||vr/d}
tjt|
��5||
ddi�ddd�y|t
ur@djgd��}
tjt|
��5||
ddi�ddd�y|tk(rR|dk(rMd}
tjt|
��5||
ddi�}||
ddi�}ddd�tj�y||
ddi�}||
ddi�}tj||�y#1swY���xYw#1swY��xYw#1swY��wxYw#1swY��_xYw#1swYyxYw#1swYyxYw#1swY��xYw)N)rrr
)r
rr)r�rz)r�r�rYrXrUrQr�)rLrMr�r�r�r�rPr�r�r�r0r1rFrGrTr{r�r�z!is not supported for object dtyper�r�rbz"SeriesGroupBy.fillna is deprecated)rLrMrGr0r1rFrTr�r�r{r�rPr�rYrXrUrQr�r8Tr^)z@SeriesGroupBy.sem called with numeric_only=True and dtype objectz=Series.skew does not allow numeric_only=True with non-numericz7cum(sum|prod|min|max) is not supported for object dtypezCCannot use numeric_only=True with SeriesGroupBy\..* and non-numericz-Allowing bool dtype in SeriesGroupBy.quantileF)rr9�hasattrr;r	r�r�r<r�rkrlrgr(�assert_series_equalrh�bool)r�r�r��grouper�serrAr/�expected_ser�expected_gb�expected_methodr��fails_on_numeric_object�
obj_resultror�r�rCrB�has_numeric_onlys                   r-�"test_deprecate_numeric_only_seriesr��s����G�
��%�
(�C�	���W�	�B��z�!��2�|�,�,�,��
�R��
&�F��)�$�L��&�&�w�/�K��k�<�8�O�"�<��5�D����J�*�.�.�5�F�?��:�%�?�C�5�C� ,�� 8�}�d��:��
�
'�
'��H�
=�	����y��4�
���
�
�	�	�
�&�� ,�� 8�}�d��7��
�
'�
'��H�
=�	#��T�]�F�	#�
�
'�
'��H�
=�	.�&��-�H�	.��:�%����v�.�H�
���v�x�0���&�+�+�A��
�]�]�9�C�
0�	-��D�,�t�,�	-�	-�	�&���h�h�
�
���]�]�9�C�
0�	-��D�,�t�,�	-�	-�	�$��<�:�5�=��
�
'�
'�
�S�
A�	9��T�5��5�F��t�8�%�8�H�	9�	���v�x�0���1�D�1���4�4�e�4��
���v�x�0�s
�
��	�	��	#�	#��	.�	.��6	-�	-��	-�	-��	9�	9�s`�;J
�I=�J
�J�J$�!	J1�)	J=�&K	�=J	�J
�
J�J!�$J.�1J:�=K�	K)ri�numpyr�rk�pandas._libsr�pandasr)rrrrr�pandas._testing�_testingr<�pandas.tests.groupbyr	rrtrur�r�r��filterwarningsr�rrr�r�rvr.r-�<module>r�s#��	��
������8�{D�{D�|������)<�=�T*�>�T*�n������ �#�H������$��s�~�~�)F�G�������4�&�4��,�!7�8�@$�9�H�I#�L@$�F�����R�S�������4��e�V�"<�=�t1�>�T�t1r.

Youez - 2016 - github.com/yon3zu
LinuXploit