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_raises.cpython-312.pyc
�

/	�g�V��`�ddlZddlZddlZddlZddlmZmZmZm	Z	ddl
mZddl
mZejddgddged��d�gd�ej gd��eeed	�gd���e	gd
��e	gd
��e	gd��gg
��d
��Zejddg��d��Zejd��Zejd��Zejd��Zejd��Zd)d�Zej6j9dgd��d��Zej6j9dddg�d��Zej6j9dddg�ej6j9dej>ej@g�d���Z!ej6j9dgd��d��Z"ej6j9dddg�d��Z#ej6j9dddg�ej6j9dej>ej@g�d ���Z$ej6j9d!gd"��d#��Z%ej6j9dgd��d$��Z&ej6j9dddg�d%��Z'ej6j9dddg�ej6j9dej>ej@g�d&���Z(ej6j9dgd��d'��Z)d(�Z*y)*�N)�Categorical�	DataFrame�Grouper�Series)�get_groupby_method_args�a�b)�keyc��|dzS)N����xs �BC:\Python312\Lib\site-packages\pandas/tests/groupby/test_raises.py�<lambda>rs
��!�a�%��)	rrr�rrr�r�	�	rrrrrrrrr�	rr�rrrrrr)�paramsc��|jS�N��param��requests r�byr s���=�=�rTFc��|jSrrrs r�groupby_seriesr"'s���=�=�rc�R�tgd�gd�td�td�d��}|S)Nrrr�	xyzwtyuio�rr	�c�d)r�range�list��dfs r�df_with_string_colr,,s-��	�,�,��q���k�"�		
�
�B��Irc�r�tgd�gd�td�tjddddddd	�d
��}|S)Nrrri�r�
��i`=r%)rr(�datetimer*s r�df_with_datetime_colr29s?��	�,�,��q���"�"�4��A�r�2�r�6�B�		
�
�B��Irc�h�tgd�gd�td�tjd��d��}|S)Nrrrr)�daysr%)rr(r1�	timedeltar*s r�df_with_timedelta_colr6Fs3��	�,�,��q���#�#��+�		
�
�B��Irc
�`�tgd�gd�td�tgd�gd�d��d��}|S)Nrrr�	rrrrr	r	r	r	r&r%T��
categories�ordered)rr(rr*s r�df_with_cat_colr<Ss6��	�,�,��q���=�/���			
�
�B��Irc���|dk(rdnt}tj||��5|�B|dk(rt||�|�n�|dk(r|j|g|���nu|j
|g|���nat
j||��5|dk(rt||�|�n,|dk(r|j|g|���n|j
|g|���ddd�ddd�y#1swY�xYw#1swYyxYw)N���match�method�agg)�
FutureWarning�tm�assert_produces_warning�getattrrB�	transform�pytest�raises)�klass�msg�how�gb�groupby_func�args�warn_msg�
warn_klasss        r�_call_and_checkrRds���!�R���]�J�	�	#�	#�J�h�	?�6��=��h��)���L�)�4�0��������|�+�d�+�����\�1�D�1����u�C�0�
6��(�?�-�G�B��-�t�4��E�\��B�F�F�<�/�$�/� �B�L�L��5��5�

6�6�6�
6�
6��6�6�s%�AC �AC�C �C	�C � C)rL)rArBrGc	��|}t||�}|j|��}|r|d}|dk(rt|d�rJ�yidd�dd�dd�dtdf�d	d�d
d�dttfdf�d
ttfdf�dttfdf�dttfdf�dtdf�dd�dd�dd�dd�dd�dd�idd�dttjd�f�dttjd�f�d d�d!d�d"d�d#tdf�d$ttjd%�f�d&td'f�d(d�d)td*f�d+d�d,d�d-td*f�d.td*f�d/d�d0ttjd1�f��|\}}	|dk(r|rd2nd3}
|
�d4�}nd5}t||	|||||�y)6N�r r'�corrwith�all�Nr>�any�bfillzCould not convert�count�cumcount�cummaxzH(function|cummax) is not (implemented|supported) for (this|object) dtype�cumminzH(function|cummin) is not (implemented|supported) for (this|object) dtype�cumprodzI(function|cumprod) is not (implemented|supported) for (this|object) dtype�cumsumzH(function|cumsum) is not (implemented|supported) for (this|object) dtype�diff�unsupported operand type�ffill�fillna�first�idxmax�idxmin�last�max�mean�-agg function failed [how->mean,dtype->object]�medianz/agg function failed [how->median,dtype->object]�min�ngroup�nunique�
pct_change�prodz-agg function failed [how->prod,dtype->object]�quantilez,cannot be performed against 'object' dtypes!�rank�semz!could not convert string to float�shift�size�skew�std�sum�varz%agg function failed [how->var,dtype->rr�GroupBy.fillna is deprecatedr>)	r�groupby�hasattr�	TypeError�NotImplementedError�re�escape�
ValueErrorrR)rLr r"rNr,r+rOrMrJrK�kindrPs            r�test_groupby_raises_stringr�xs���
�B�"�<��4�D�	���r��	�B��
��W���:�%��r�:�.�.�.��;�
�z�;�
�z�;�	��;�	�Y� 3�4�	;�
	��;�	�J�
;�	�
 �)�,�V�
�;�	�
 �)�,�V�
�;�	�
 �)�,�W�
�;�&	�
 �)�,�V�
�';�.	��6�7�/;�0	��1;�2	�*�3;�4	��5;�6	�*�7;�8	�*�9;�:	�
�;;�<	�z�=;�>	���I�I�E�F�
�?;�F	���I�I�G�H�
�G;�N	�z�O;�P	�*�Q;�R	�:�S;�T	�y�"<�=�U;�V	���I�I�E�F�
�W;�^	�Y� N�O�_;�`	�
�a;�b	�
�?�@�c;�d	��e;�f	�
�g;�h	��@�A�i;�j	�
�?�@�k;�l	�z�m;�n	���I�I�=�>�
�o;�v�w;�J�E�3�z�x��)�x�{���V�7�8�����E�3��R��t�X�FrrBrGc���|}|j|��}|r|d}d�}tjtd��5t	||�|�ddd�y#1swYyxYw)NrTr'c��td���N�Test error message�r}rs r�funcz,test_groupby_raises_string_udf.<locals>.func�����,�-�-rr�r?�r{rHrIr}rF)rLr r"r,r+rMr�s       r�test_groupby_raises_string_udfr��s_��	�B�	���r��	�B��
��W��.�
���y�(<�	=�����C���������A�A�groupby_func_npc	���|}|j|��}|r|d}tjdtjttjd�fi|\}}|rd}	nd}	t|||||d|	��y)	NrTr'rWrj�using SeriesGroupBy.[sum|mean]�!using DataFrameGroupBy.[sum|mean]r
�rP)r{�nprxrir}rr�rR)
rLr r"r�r,r+rMrJrKrPs
          r�test_groupby_raises_string_npr��s���
�B�	���r��	�B��
��W��	���
�
�����I�I�E�F�
���
�J�E�3��3��6���E�3��R��"�x�Prc	�<�|}t||�}|j|��}|r|d}|dk(rt|d�rJ�yidd�dd�dd�dtdf�d	d�d
d�dd�dd�d
tdf�dtdf�dd�dd�dd�dd�dd�dd�dd�idd�dd�dd�dd�dd�dd�dtdf�d td!f�d"d�d#d�d$d�d%d�d&d�d'td(j	d)d*g�f�d+d�d,td-f�d.td/f��|\}}	|d0vrd1|�d2�}
n|dk(r|rd3nd4}|�d5�}
nd6}
t||	|||||
�7�y)8NrTr'rUrVrWrXrYz+cannot perform __mul__ with this index typerZr[r\r]r^z3datetime64 type does not support cumprod operationsr_z2datetime64 type does not support cumsum operationsr`rbrcrdrerfrgrhrirkrlrmrnroz/cannot perform __truediv__ with this index typerpz%datetime64 type does not support prodrqrrrsrtrurv�|z1dtype datetime64\[ns\] does not support reductionz0datetime64 type does not support skew operationsrwrx�/datetime64 type does not support sum operationsryz/datetime64 type does not support var operations)rXrV�'z&' with datetime64 dtypes is deprecatedrrrzr>r�)rr{r|r}�joinrR)rLr r"rNr2r+rOrMrJrKrPr�s            r�test_groupby_raises_datetimer��s���
�B�"�<��4�D�	���r��	�B��
��W���:�%��r�:�.�.�.��+�
�z�+�
�z�+�	��+�	�Y� M�N�	+�
	��+�	�J�
+�	�*�+�	�*�+�	�I�T�U�+�	�9�R�S�+�	�
�+�	��+�	�*�+�	��+�	�*�+� 	�*�!+�"	�
�#+�$	�z�%+�&	�
�'+�(	�*�)+�*	�z�++�,	�*�-+�.	�:�/+�0	�y�"S�T�1+�2	��C�D�3+�4	�J�5+�6	�
�7+�8	�z�9+�:	��;+�<	�
�=+�>	���H�H�H�F��
�
�?+�P	�z�Q+�R	�	�L�M�S+�T	�	�L�M�U+�V�W+�J�E�3�Z�~�%��|�n�$J�K��	��	!�)�x�{���V�7�8�����E�3��R��t�h�Orc���|}|j|��}|r|d}d�}tjtd��5t	||�|�ddd�y#1swYyxYw)NrTr'c��td��r�r�rs rr�z.test_groupby_raises_datetime_udf.<locals>.funcDr�rr�r?r�)rLr r"r2r+rMr�s       r� test_groupby_raises_datetime_udfr�<s_��	�B�	���r��	�B��
��W��.�
���y�(<�	=�����C�������r�c	���|}|j|��}|r|d}tjtdftjdi|\}}|rd}	nd}	t|||||d|	��y)	NrTr'r�rWr�r�r
r��r{r�rxr}rirR)
rLr r"r�r2r+rMrJrKrPs
          r�test_groupby_raises_datetime_npr�Ksw��
�B�	���r��	�B��
��W��	����M�N�
�������J�E�3�
�3��6���E�3��R��"�x�Prr�)rpr^rvryc�T�|}|jd��}ttdd||g�y)NrrTz/timedelta64 type does not support .* operationsrA)r{rRr})r�r6r+rMs    r�test_groupby_raises_timedeltar�cs1��	�B�	���s��	�B���9��
��
�
rc	�r�|}t||�}|j|��}|r|d}|dk(rt|d�rJ�yidd�dd�dd�dtdf�d	d�d
d�dttfdf�d
ttfdf�dttfdf�dttfdf�dtdf�dd�d|stdfnd�dd�dd�dd�dd�idd�dtdjdd g�f�d!tdjd"d#g�f�d$d�d%d�d&d�d'td(f�d)td*f�d+td,f�d-d�d.tdjd/d0g�f�d1d�d2d�d3tdjd4d5g�f�d6tdjd7d8g�f�d9td:f�d;tdjd<d=g�f��|\}	}
|dk(r|rd>nd?}|�d@�}ndA}t
|	|
|||||�y)BNrTr'rUrVrWrXrY�=unsupported operand type\(s\) for \*: 'Categorical' and 'int'rZr[r\zz(category type does not support cummax operations|category dtype not supported|cummax is not supported for category dtype)r]zz(category type does not support cummin operations|category dtype not supported|cummin is not supported for category dtype)r^z|(category type does not support cumprod operations|category dtype not supported|cumprod is not supported for category dtype)r_zz(category type does not support cumsum operations|category dtype not supported|cumsum is not supported for category dtype)r`zDunsupported operand type\(s\) for -: 'Categorical' and 'Categorical'rbrc�SCannot setitem on a Categorical with a new category \(0\), set the categories firstrdrerfrgrhrir�z2'Categorical' .* does not support reduction 'mean'�2category dtype does not support aggregation 'mean'rkz4'Categorical' .* does not support reduction 'median'�4category dtype does not support aggregation 'median'rlrmrnrozDunsupported operand type\(s\) for /: 'Categorical' and 'Categorical'rp�.category type does not support prod operationsrqzNo matching signature foundrrrs�1'Categorical' .* does not support reduction 'sem'�1category dtype does not support aggregation 'sem'rtrurv�0dtype category does not support reduction 'skew'�.category type does not support skew operationsrw�1'Categorical' .* does not support reduction 'std'�1category dtype does not support aggregation 'std'rx�-category type does not support sum operationsry�1'Categorical' .* does not support reduction 'var'�1category dtype does not support aggregation 'var'rrrzr>)rr{r|r}r~r�rR)
rLr r"rN�using_copy_on_writer<r+rOrMrJrKr�rPs
             r�test_groupby_raises_categoryr�rs���

�B�"�<��4�D�	���r��	�B��
��W���:�%��r�:�.�.�.��v�
�z�v�
�z�v�	��v�	��L�
�	v�	��v�	�J�v�	�
 �)�,�
:�
�v� 	�
 �)�,�
:�
�!v�,	�
 �)�,�
;�
�-v�8	�
 �)�,�
:�
�9v�D	��S�
�Ev�L	��Mv�N	�
#�	
�
'�
��[v�\	��]v�^	�*�_v�`	�*�av�b	�
�cv�d	�z�ev�f	���H�H�H�H��
�
�gv�x	���H�H�J�J��
�
�yv�J	�z�Kv�L	�*�Mv�N	�:�Ov�P	��S�
�Qv�X	��L�M�Yv�Z	�Y� =�>�[v�\	�
�]v�^	���H�H�G�G��
�
�_v�p	��qv�r	�
�sv�t	���H�H�F�D��
�
�uv�F	���H�H�G�G��
�
�Gv�X	�	�J�K�Yv�Z	���H�H�G�G��
�
�[v�l�mv�J�E�3�p�x��)�x�{���V�7�8�����E�3��R��t�X�Frc���|}|j|��}|r|d}d�}tjtd��5t	||�|�ddd�y#1swYyxYw)NrTr'c��td��r�r�rs rr�z.test_groupby_raises_category_udf.<locals>.funcr�rr�r?r�)rLr r"r<r+rMr�s       r� test_groupby_raises_category_udfr�sa��
�B�	���r��	�B��
��W��.�
���y�(<�	=�����C�������r�c	���|}|j|��}|r|d}tjtdftjtdfi|\}}|rd}	nd}	t|||||d|	��y)	NrTr'r�r�r�r�r
r�r�)
rLr r"r�r<r+rMrJrKrPs
          r�test_groupby_raises_category_npr�s���
�B�	���r��	�B��
��W��	����K�L�
����@�
���
�J�E�3��3��6���E�3��R��"�x�Prc	�\�|}tgd�gd�d��|d<t||�}|j||��}	|r|	d}	|dk(rt|	d�rJ�y|xr*t	d	�|	j
j
�D��}
|s5|d
k7r0t|t�r t|dt�r
|ddgk(r|
rJ�d}
|d
k(rd
}
idd�dd�dd�dtdf�dd�dd�dttfdf�dttfdf�dttfdf�dttfdf�dtdf�dd�d |std!fnd�d"d�d#|
rtd$fnd�d%|
rtd$fnd�d&d�id'd�d(td)f�d*td+f�d,d�d-d�d.d�d/tdf�d0td1f�d2td3f�d4d�d5td6jd7d8g�f�d9d�d:d�d;td6jd<d=g�f�d>td6jd?d@g�f�dAtdBf�dCtd6jdDdEg�f��|\}}|d k(r|rdFndG}
|
�dH�}nd3}t||||	|||�y)INr8r%Tr9r)r �observedr'rUc3�4K�|]}|j���y�wr)�empty)�.0�groups  r�	<genexpr>z;test_groupby_raises_category_on_category.<locals>.<genexpr>Hs����'T�����'T�s�rGrr	FrVrWrXrYr�rZr[r\zz(cummax is not supported for category dtype|category dtype not supported|category type does not support cummax operations)r]zz(cummin is not supported for category dtype|category dtype not supported|category type does not support cummin operations)r^z|(cumprod is not supported for category dtype|category dtype not supported|category type does not support cumprod operations)r_zz(cumsum is not supported for category dtype|category dtype not supported|category type does not support cumsum operations)r`rarbrcr�rdrez(empty group due to unobserved categoriesrfrgrhrir�rkr�rlrmrnrorpr�rqr>rrrsr�r�r�rtrurvr�r�rwr�r�rxr�ryr�r�rrrz)rrr{r|rX�groups�values�
isinstancer)�strr}r~r�r�rR)rLr r"rNr�r�r<r+rOrM�empty_groupsrJrKr�rPs               r�(test_groupby_raises_category_on_categoryr�-s,��
�B��5�'���B�s�G�
#�<��4�D�	���r�H��	-�B��
��W���:�%��r�:�.�.�.���<�T�C�'T����AQ�AQ�AS�'T�$T�L���;���r�4� ��r�!�u�c�"��3��*�������
�k����d�
�z�d�
�z�d�	��d�	��L�
�	d�	��d�	�J�d�	�
 �)�,�
@�
�d� 	�
 �)�,�
@�
�!d�,	�
 �)�,�
A�
�-d�8	�
 �)�,�
@�
�9d�D	��6�7�Ed�F	��Gd�H	�
#�	
�
'�
��Ud�V	��Wd�X	���I�J�
�]d�^	���I�J�
�cd�d	�
�ed�f	�z�gd�h	��P�Q�id�j	�9�T�U�kd�l	�z�md�n	�*�od�p	�:�qd�r	�y�"<�=�sd�t	��L�M�ud�v	�Y��O�wd�x	�
�yd�z	���H�H�G�G��
�
�{d�L	��Md�N	�
�Od�P	���H�H�D�F��
�
�Qd�b	���H�H�G�G��
�
�cd�t	�	�J�K�ud�v	���H�H�G�G��
�
�wd�H�Id�J�E�3�L�x��)�x�{���V�7�8�����E�3��R��t�X�Frc��tdgdgdgd��}d}tjt|��5|j	dd��}ddd�tjtd	��5d
ddd�y#1swY�3xYw#1swYyxYw)Nrrr)rr	r&z+DataFrame.groupby with axis=1 is deprecatedr?r)�axisz'Cannot subset columns when using axis=1r	)rrDrErCr{rHrIr�)r+rKrMs   r�%test_subsetting_columns_axis_1_raisesr��s���	�!��A�3�a�S�1�	2�B�
7�C�	�	#�	#�M��	=�%�
�Z�Z��!�Z�
$��%�	���z�)R�	S��
�3����%�%����s�A6�'B�6A?�B)r>)+r1r�numpyr�rH�pandasrrrr�pandas._testing�_testingrD�pandas.tests.groupbyr�fixture�array�dict�zipr(r r"r,r2r6r<rR�mark�parametrizer�r�rxrir�r�r�r�r�r�r�r�r�r�r
rr�<module>r�s���
�	��
����8������	��	�c�
��C���#�����,�-��S��q��6�
7�8��*�+�	�+�	,�f�5P�.Q�R��
��
�������e�}�%��&�����	��	����	��	����	��	����
��
� 6�(������ >�?�PG�@�PG�f�������� 4�5��6���������� 4�5������*�R�V�V�R�W�W�,=�>�Q�?�6�Q�2������ >�?�BP�@�BP�J�������� 4�5��6���������� 4�5������*�R�V�V�R�W�W�,=�>�Q�?�6�Q�,������!C�D��E�������� >�?�LG�@�LG�^�������� 4�5��6���������� 4�5������*�R�V�V�R�W�W�,=�>�Q�?�6�Q�2������ >�?�TG�@�TG�nr

Youez - 2016 - github.com/yon3zu
LinuXploit