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/generic/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

/	�g'D���ddlmZmZddlZddlZddlmZddlmZm	Z	m
Z
mZddlm
Zd
d�ZGd�d�ZGd�d	�Zy)�)�copy�deepcopyN)�	is_scalar)�	DataFrame�Index�Series�
date_rangec��t|t�rt|g|jz�}|��t	|�r]|dk(r/d}t
j}|j|jd�n�tj||��}|j|�n�tj|�}|j�}||jdz}||jdzdk7rtd��tj||�j!|�}n.t
j"j%d�j'|�}||fd|i|��S)z�
    construct an object for the given shape
    if value is specified use that if its a scalar
    if value is an array, repeat it as needed
    N�empty��dtyperz!invalid value passed in construct�r
)�
isinstance�int�tuple�	_AXIS_LENr�np�float64�pop�_info_axis_namer�fill�prod�ravel�shape�	Exception�repeat�reshape�random�default_rng�standard_normal)�boxr�valuer
�kwargs�arr�fshape�	new_shapes        �CC:\Python312\Lib\site-packages\pandas/tests/generic/test_generic.py�	constructr(s���%����u�g��
�
�-�.�����U��������
�
���
�
�3�.�.��5��h�h�u�E�2��������W�W�U�^�F��+�+�-�C�����1��-�I���	�	�!��$��)�� C�D�D��)�)�C��+�3�3�E�:�C��i�i�#�#�A�&�6�6�u�=���s�*�%�*�6�*�*�c�8�eZdZejjdejed�D��cic]}||j���c}}e	ed�D��cic]}||j���c}}�g�d��Z
d�Zd�Zd�Z
d�Zd�Zd	�Zd
�Zejjdgd��d��Zd
�Zd�Zejjdeed�d�g�ejjdgd��d���Zd�Zycc}}wcc}}w)�TestGeneric�func�ABCDc��td�}|jD]c}||i}t|dfi|��}|jdi||i��}|j	�}t||td��t
j||��ey)Nr-��abcd�)�list�_AXIS_ORDERSr(�renamer�setattr�tm�assert_equal)	�self�frame_or_seriesr,�idx�axisr#�obj�result�expecteds	         r'�test_renamezTestGeneric.test_rename8s~���6�l��#�0�0�	.�D��C�[�F��O�Q�9�&�9�C� �S�Z�Z�/�4��,�/�F��x�x�z�H��H�d�D��L�1��O�O�F�H�-�	.r)c	�j�d}t|j�D�cic]&}|j|�tt|����(}}t	||fi|��}|j�}t
j||�|j�}t	||fddi|��}t|t�r|jdd|_t
j|jd��|�tjgd��}t	||fd|i|��}|j�}t
j||�ycc}w)Nr/r"rrT)�drop)TTFT)�ranger�_get_axis_namer2r(�_get_numeric_datar6r7�_get_bool_datarr�columns�reset_indexr�array)	r8r9�n�ir#�or=r>r$s	         r'�test_get_numeric_dataz!TestGeneric.test_get_numeric_dataNs��
���?�4�4�5�
��
�*�*�1�-�t�E�!�H�~�=�
��
�
�o�q�3�F�3���$�$�&��
�����"��!�!�#���_�a�I�w�I�&�I���a��#� �y�y��!�}�H��
����*�*��*�5�x�@��h�h�0�1���o�q�>��>�v�>���$�$�&��
�����"��/
s�+D0c�^�t|d��}d|j�d�}tjt|��5t|dk(�ddd�tjt|��5t|dk(�ddd�tjt|��5t|�ddd�t|dd��}tjt|��5t|dk(�ddd�tjt|��5t|dk(�ddd�tjt|��5t|�ddd�t|dtj��}tjt|��5t|dk(�ddd�tjt|��5t|dk(�ddd�tjt|��5t|�ddd�t|d��}tjt|��5t|�ddd�t|dd��}t|dd��}tjt|��5|r	ddd�tjt|��5|xr|ddd�tjt|��5|xs|ddd�tjt|��5|ddd�y#1swY���xYw#1swY���xYw#1swY��oxYw#1swY��<xYw#1swY��xYw#1swY���xYw#1swY���xYw#1swY���xYw#1swY��mxYw#1swY��>xYw#1swY��xYw#1swY��xYw#1swY��xYw#1swYyxYw)	Nr/�rzThe truth value of a z
 is ambiguous��matchr�)rr")r(�__name__�pytest�raises�
ValueError�boolr�nan)r8r9r<�msg�obj1�obj2s      r'�test_nonzerozTestGeneric.test_nonzerois�����q�1��%�o�&>�&>�%?�}�M��
�]�]�:�S�
1�	�����N�	�
�]�]�:�S�
1�	�����N�	�
�]�]�:�S�
1�	���I�	���q��:��
�]�]�:�S�
1�	�����N�	�
�]�]�:�S�
1�	�����N�	�
�]�]�:�S�
1�	���I�	���q����?��
�]�]�:�S�
1�	�����N�	�
�]�]�:�S�
1�	�����N�	�
�]�]�:�S�
1�	���I�	���q�1��
�]�]�:�S�
1�	���I�	�
����;������;��
�]�]�:�S�
1�	���	��]�]�:�S�
1�	��M�T��	�
�]�]�:�S�
1�	��L�D��	�
�]�]�:�S�
1�	��H�	�	�S	�	��	�	��	�	��	�	��	�	��	�	��	�	��	�	��	�	��
	�	��	�	��	�	��	�	��	�	�s��K<�+L	�L�L#�L0�>L=�	M
�;M�-M$�)M1�4M>�N�N�/N#�<L�	L�L �#L-�0L:�=M�
M�M!�$M.�1M;�>N�N�N �#N,c�����fd�}d�j�d�}tjt|��5|gd��ddd�|d�|d�|d�y#1swY�"xYw)	Nc�"��t�dd|��S)N�rQ)rr"r
)r()r
r9s �r'�fz;TestGeneric.test_frame_or_series_compound_dtypes.<locals>.f�s����_�A�Q�e�L�Lr)z+compound dtypes are not implemented in the z constructorrO))�Az
datetime64[h])�B�str)�C�int32�int64rzM8[ns])rRrSrT�NotImplementedError)r8r9r_rXs `  r'�$test_frame_or_series_compound_dtypesz0TestGeneric.test_frame_or_series_compound_dtypes�sp���	M�
�%�.�.�/�|�
=�	�
�]�]�.�c�
:�	F�
�D�E�	F�	
�'�
�	�)��	�(��
	F�	F�s�A�A'c�4�t|d��}d|_t|d��}d|_dD]*}t||�d�}tj||��,dD]*}t||�|�}tj||��,dD]\}t||�|�}tj||�tj|||z�tj|||z��^|j|�}tj||�||z}tj|�dD]k}t||�|�}t||�|�}tj|�tj||z�tj||z��my)Nr^rN�foo�bar)�__add__�__sub__�__truediv__�__mul__rQ)�__eq__�__le__�__ge__)r(�name�getattrr6�assert_metadata_equivalent�
combine_first)r8r9rK�o2�opr=�v1�v2s        r'�test_metadata_propagationz%TestGeneric.test_metadata_propagation�s���
�o�Q�/�����
��a�
0�����C�	5�B�#�W�Q��^�A�&�F��)�)�!�V�4�	5�
C�	5�B�#�W�Q��^�A�&�F��)�)�!�V�4�	5�
1�	6�B����B���"�B��)�)�!�R�0��)�)�!�R�"�W�5��)�)�!�R�"�W�5�		6�����$��
�%�%�a��0��R���
�%�%�f�-�1�	3�B����B���"�B����B���#�B��)�)�"�-��)�)�"�r�'�2��)�)�"�r�'�2�
	3r)c���t|d��}|jtj|j�k(sJ�|jdt|j�zk(sJ�y)N�
rN)r(�sizerrr�len�axes�r8r9rKs   r'�test_size_compatzTestGeneric.test_size_compat�sN��
�o�R�0���v�v�������)�)�)�)��v�v��s�1�6�6�{�*�*�*�*r)c��t|d��}tjtdd��5t	tj|d��dk(sJ�t	tj|d��dk(sJ�	ddd�y#1swYyxYw)Nr|rNz.swapaxes' is deprecatedF)rP�check_stacklevel�r)r(r6�assert_produces_warning�
FutureWarningr~r�array_splitr�s   r'�test_split_compatzTestGeneric.test_split_compat�sw���o�R�0��
�
'�
'��!;�e�
�	2��r�~�~�a��+�,��1�1�1��r�~�~�a��+�,��1�1�1�		2�	2�	2�s�A	A=�=Bc�4�t|d�}d}d}tjt|��5|j	|��ddd�tjt|��5|j|��ddd�tjt|��5|j
|��ddd�tjt|��5|j|��ddd�y#1swY��xYw#1swY��xYw#1swY�XxYw#1swYyxYw)Nr�z	Star Warszunexpected keywordrO)�epic)r(rSrT�	TypeError�max�var�sum�any)r8r9r<�starwars�errmsgs     r'�test_stat_unexpected_keywordz(TestGeneric.test_stat_unexpected_keyword�s������+����%��
�]�]�9�F�
3�	#��G�G��G�"�	#�
�]�]�9�F�
3�	#��G�G��G�"�	#�
�]�]�9�F�
3�	#��G�G��G�"�	#�
�]�]�9�F�
3�	#��G�G��G�"�	#�	#�
	#�	#��	#�	#��	#�	#��	#�	#�s/�C*�"C6�D�D�*C3�6C?�D�D)r��cumsumr�r�c��t|d�}t||�}|j|k(sJ�|jj	|�sJ�y)Nr�)r(rsrR�__qualname__�endswith)r8r,r9r<r_s     r'�test_api_compatzTestGeneric.test_api_compatsF��
���+���C�����z�z�T�!�!�!��~�~�&�&�t�,�,�,r)c�\�t|d�}tjdg�}d}tjt
|��5|j
|��ddd�tjt
|��5|j|��ddd�tjt
|��5|j|��ddd�tjt
|��5|j|��ddd�y#1swY��xYw#1swY��xYw#1swY�XxYw#1swYyxYw)Nr�r�$the 'out' parameter is not supportedrO��out)
r(rrHrSrTrUr�r�r�r�)r8r9r<r�r�s     r'�test_stat_non_defaults_argsz'TestGeneric.test_stat_non_defaults_args
s������+���h�h��s�m��7��
�]�]�:�V�
4�	��G�G��G��	�
�]�]�:�V�
4�	��G�G��G��	�
�]�]�:�V�
4�	��G�G��G��	�
�]�]�:�V�
4�	��G�G��G��	�	�
	�	��	�	��	�	��	�	�s0�C>�6D
�,D�"D"�>D�
D�D�"D+c�d�dgdg|jdz
zz}t||dd��}tj|j	�|�tj|j	dd��|�tj|j	dd	��|�d
gdg|jdz
zz}t||dd��}tj|j	�|�tj|j	dd��|�tj|j	dd��|�y)
Ni�rQ�int8)r
r"rgp�@)�before�after���g@�@i��g`�FAg��>A)rr(r6r7�truncate)r8r9r�small�bigs     r'�test_truncate_out_of_boundsz'TestGeneric.test_truncate_out_of_boundss�����1�#��!:�!:�Q�!>�?�@���/�5��a�H��
������(�%�0�
������a�s��;�U�C�
������b���<�e�D����s�o�&?�&?�!�&C�D�E�����f�A�F��
��������,�
������A�S��9�3�?�
������B�c��:�C�@r)c�&�|jd��S)NF��deep�r��xs r'�<lambda>zTestGeneric.<lambda>+s��1�6�6�u�6�#5�r)c�&�|jd��S)NTr�r�r�s r'r�zTestGeneric.<lambda>+s�����T��AR�r)r)rrQrc�d�t||�}||�}||usJ�tj||�y�N)r(r6r7)r8r9rr,r<�obj_copys      r'�test_copy_and_deepcopyz"TestGeneric.test_copy_and_deepcopy)s5�����/����9���s�"�"�"�
����#�&r)c��|�}d}tjt|��5|j}ddd�|jusJ�y#1swY�xYw)Nz&(Series|DataFrame)._data is deprecatedrO)r6r��DeprecationWarning�_data�_mgr)r8r9r<rX�mgrs     r'�test_data_deprecatedz TestGeneric.test_data_deprecated5sN�����6��
�
'�
'�(:�#�
F�	��)�)�C�	��c�h�h����	�	�s�
A�AN)rR�
__module__r�rS�mark�parametrizerb�lowerr2rr?rLr[rgrzr�r�r�r�r�r�rrr�r�)�.0r�s00r'r+r+7s#���[�[�����I�I�#'��<�0�a�Q����	�\�0��$�v�,�7�Q�A�q�w�w�y�L�7�8�	
��.��.�#�6/�b�(03�d+�2�#��[�[���V�%D�E�-�F�-��A�"�[�[����	
�x�5�7R�S���[�[���W�i�0�'�1�	�
'���s
1��7s�D�Dr+c���eZdZejjdeed�ej��eed�D���cgc]
}t|���c}}}e��g�d��Zd�Z
d�Zd�Zd�Zd	�Zd
�Zejjdeed�ej��eed�D���cgc]
}t|���c}}}e��g�d��Zd�Zd
�Zejjdeed�ej��eed�D���cgc]
}t|���c}}}e��g�d��Zd�Zd�Zd�Zd�Zdd�Zycc}}}wcc}}}wcc}}}w)�TestNDFrame�serr|rc�L�tj|j�|�yr�)r6�assert_series_equal�squeeze�r8r�s  r'�test_squeeze_series_noopz$TestNDFrame.test_squeeze_series_noop@s��	���s�{�{�}�c�2r)c��ttjd��}tj|j�|�y)Nr)rr�eyer6�assert_frame_equalr��r8�dfs  r'�test_squeeze_frame_noopz#TestNDFrame.test_squeeze_frame_noopKs*��
�r�v�v�a�y�
!��
���b�j�j�l�B�/r)c	�0�ttjjd�j	d�tt
d�t��tddd���	�jd
g��}tj|j�|d
�y)Nr�r|r/r-r�
2000-01-01r|ra��periods�freq�rF�indexr`�rF)
rrrrr rr2�objectr	�reindexr6r�r�r�s  r'�test_squeeze_frame_reindexz&TestNDFrame.test_squeeze_frame_reindexPsr��
��I�I�!�!�!�$�4�4�W�=��$�v�,�f�5��\�2�C�@�
��'�3�%�'�
 �		�
	���r�z�z�|�R��W�5r)c���tgdtj��}t|g�}t	j
||j
��t	j
||j
��y)N�five)rrr
)rrrrr6r�r�)r8�empty_series�empty_frames   r'�test_squeeze_0_len_dimz"TestNDFrame.test_squeeze_0_len_dimYsR���b�v�R�Z�Z�@�����/��
���|�\�-A�-A�-C�D�
���|�[�-@�-@�-B�Cr)c	��ttjjd�j	d�tt
d�t��tddd���	�jdd�dd�f}|jd
k(sJ�tj|jd��|jd�tj|jd
��|jd�tj|jd��|jdd�df�tj|jd��|jdd�df�|j�|jdk(sJ�d}tjt |��5|jd��ddd�d}tjt |��5|jd��ddd�y#1swY�BxYw#1swYyxYw)Nr)rQr/r-rr�rQrar�r�)rQrQr�r;r�rF)rrz)No axis named 2 for object type DataFramerOz)No axis named x for object type DataFramer�)rrrrr rr2r�r	�ilocrr6r�r�rSrTrU)r8r�rXs   r'�test_squeeze_axiszTestNDFrame.test_squeeze_axis`s���
��I�I�!�!�!�$�4�4�V�<��$�v�,�f�5��\�1�3�?�
��$�q�"�1�"�u�	��
�x�x�6�!�!�!�
���r�z�z�q�z�1�2�7�7�1�:�>�
���r�z�z�w�z�7������D�
���r�z�z�q�z�1�2�7�7�1�a�4�=�A�
���r�z�z�y�z�9�2�7�7�1�a�4�=�I��z�z�|�r�w�w�t�}�,�,�,�9��
�]�]�:�S�
1�	��J�J�A�J��	�9��
�]�]�:�S�
1�	!��J�J�C�J� �	!�	!�	�	��	!�	!�s�G*�G6�*G3�6G?c	��ttjjd�j	d�tt
d�t��tddd���	�}tj|jd
��|�y)Nr)r^r/r-rr�r^rar�r�rr�)rrrrr rr2r�r	r6r�r�r�s  r'�test_squeeze_axis_len_3z#TestNDFrame.test_squeeze_axis_len_3ts`��
��I�I�!�!�!�$�4�4�V�<��$�v�,�f�5��\�1�3�?�
��
	���b�j�j�a�j�0�"�5r)c	���ttd�tj��}t	j
tj|�|�ttjjd�jd�ttd�t��tddd���	�jd
g��}t	j
tj|�|d
�y)Nrrr�r-r�r|rar�r�r`r�)rrBrrr6r�r�rrrr rr2r�r	r�)r8�sr�s   r'�test_numpy_squeezezTestNDFrame.test_numpy_squeeze|s����5��8�2�:�:�.��
���r�z�z�!�}�a�0�
��I�I�!�!�!�$�4�4�W�=��$�v�,�f�5��\�2�C�@�
��'�3�%�'�
 �		�
	���r�z�z�"�~�r�#�w�7r)c�L�tj|j�|�yr�)r6r��	transposer�s  r'�test_transpose_seriesz!TestNDFrame.test_transpose_series�s��	���s�}�}���4r)c	�$�ttjjd�j	d�tt
d�t��tddd���	�}tj|j�j�|�y)
Nrr�r-rr�r|rar�r�)rrrrr rr2r�r	r6r�r�r�s  r'�test_transpose_framez TestNDFrame.test_transpose_frame�sd��
��I�I�!�!�!�$�4�4�W�=��$�v�,�f�5��\�2�C�@�
��
	���b�l�l�n�6�6�8�"�=r)c	�X�ttjjd�j	d�tt
d�t��tddd���	�}tj||�}|tur)tjtj|�|�tjtjtj|��|�d
}tj t"|��5tj|d�
�ddd�y#1swYyxYw)Nrr�r-rr�r|rar�r�z%the 'axes' parameter is not supportedrOrQ)r)rrrrr rr2r�r	r6�get_objrr�r�r7rSrTrU)r8r9r<rXs    r'�test_numpy_transposez TestNDFrame.test_numpy_transpose�s�����I�I�!�!�!�$�4�4�W�=��$�v�,�f�5��\�2�C�@�
��
�j�j��o�.���f�$��"�"�2�<�<��#4�c�:�	������R�\�\�#�%6�7��=�5��
�]�]�:�S�
1�	&��L�L��1�%�	&�	&�	&�s�?D � D)c���gd�}|j|�}t|jj|�|jj|�|j��}tj||�y)N�rQr�����r^r�)�datar�r
)�taker�valuesr�r
r6r�)r8r��indicesr�r>s     r'�test_take_serieszTestNDFrame.test_take_series�sZ��'���h�h�w����������)��)�)�.�.��)��)�)�
��
	���s�H�-r)c	��gd�}ttjjd�j	d�tt
d�t��tddd�	��
�}|j|�}t|jj|d��|jj|�|j�
�}tj||�y)Nr�rr�r-rr�r|rar�r�rr�)r�r�rF)rrrrr rr2r�r	r�r�r�rFr6r�)r8r�r�r�r>s     r'�test_take_framezTestNDFrame.test_take_frame�s���&��
��I�I�!�!�!�$�4�4�W�=��$�v�,�f�5��\�2�C�@�
��
�g�g�g����������a��0��(�(�-�-��(��J�J�
��
	���c�8�,r)c��gd�}ttd��}tj||�}d}t	j
t|��5|j|d��ddd�d}t	j
t|��5|j||��ddd�d	}t	j
t|��5|j|d
��ddd�y#1swY�|xYw#1swY�OxYw#1swYyxYw)N)���rrrQr�z1take\(\) got an unexpected keyword argument 'foo'rOr)rir�r�z%the 'mode' parameter is not supported�clip)�mode)	rrBr6r�rSrTr�r�rU)r8r9r�r<rXs     r'�test_take_invalid_kwargsz$TestNDFrame.test_take_invalid_kwargs�s�������a��!���j�j��o�.��B��
�]�]�9�C�
0�	%��H�H�W�!�H�$�	%�5��
�]�]�:�S�
1�	+��H�H�W�'�H�*�	+�6��
�]�]�:�S�
1�	+��H�H�W�6�H�*�	+�	+�	%�	%��	+�	+��	+�	+�s$�C�C'�>C3�C$�'C0�3C<c�B�|}|t��}|jj�}|D]q}|j|�|j|�k(sJ�|j	|�|j	|�k(sJ�|j|�|j|�k(r�qJ�y)Nr)r��_AXIS_TO_AXIS_NUMBER�keys�_get_axis_numberrC�_get_block_manager_axis)r8r9r!r<r��vs      r'�test_axis_classmethodsz"TestNDFrame.test_axis_classmethods�s����������)�)�.�.�0���	T�A��'�'��*�c�.B�.B�1�.E�E�E�E��%�%�a�(�C�,>�,>�q�,A�A�A�A��.�.�q�1�S�5P�5P�QR�5S�S�S�S�	Tr)c���tddg�}|tur|j�}|j|jusJ�|j	�}|j|jusJ�y)NrQr)rr�to_frame�flagsr)r8r9r<rZs    r'�test_flags_identityzTestNDFrame.test_flags_identity�sY���a��V�n���i�'��,�,�.�C��y�y�C�I�I�%�%�%��x�x�z���z�z����*�*�*r)Nc��d}tjt|��5tddgi�j	�ddd�y#1swYyxYw)NzPDataFrame.bool is now deprecated and will be removed in future version of pandasrO�colF)r6r�r�rrV)r8�msg_warns  r'�
test_bool_depzTestNDFrame.test_bool_dep�sK��
*�	��
'�
'�
�X�
F�	/��u�u�g�&�'�,�,�.�	/�	/�	/�s�A�A
)�returnN)rRr�r�rSr�r�rrBrrrbr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr)r�rJrbs000r'r�r�=sn���[�[���
��5��9�B�J�J�/��E�"�I�.�.�q�C��F�.�f�=�	
��3��3�0�
6�D�!�(6�	8��[�[���
��5��9�B�J�J�/��E�"�I�.�.�q�C��F�.�f�=�	
��5��5�>�&�&�[�[���
��5��9�B�J�J�/��E�"�I�.�.�q�C��F�.�f�=�	
��.��.�
-�+�$T�+�/��[/��N/��L/s�E�9E$�$E+r�)NN)rr�numpyrrS�pandas.core.dtypes.commonr�pandasrrrr	�pandas._testing�_testingr6r(r+r�r1r)r'�<module>rsC���
�
�/����+�@C�C�L{/�{/r)

Youez - 2016 - github.com/yon3zu
LinuXploit