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 :  /Python312/Lib/site-packages/pandas/tests/io/pytables/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Python312/Lib/site-packages/pandas/tests/io/pytables/__pycache__/test_round_trip.cpython-312.pyc
�

0	�gAI��6�ddlZddlZddlZddlZddlmZddlmZddl	Z
ddl	mZmZm
Z
mZmZmZmZmZddlmZmZddlmZej4j6Zd�Zd�Zd	�Zd
�Z d�Z!d�Z"d
�Z#d�Z$d�Z%ej4jMd�d��Z'd�Z(d�Z)ej4jMd�d��Z*d�Z+ej4jYddejZdej\��g�d��Z/d�Z0ej4jYdejbejde3ddg�d��Z4d �Z5d!�Z6ej4jYddejZdej\��g�d"��Z7d*d#�Z8d*d$�Z9d%�Z:d&�Z;d'�Z<d(�Z=d)�Z>y)+�N)�	Timestamp)�is_platform_windows)�	DataFrame�
DatetimeIndex�Index�Series�_testing�bdate_range�
date_range�read_hdf)�
_maybe_remove�ensure_clean_store)�_test_decoratorsc���tj�5��fd�}ttjdtj
��t
dd����}tj||d|��ttd�dtd�D�cgc]}d	|����	c}�
�}tj||d|��tdtjd
�jd�zttd�t��ttd�D�cgc]}d|����	c}t����}tj||d|��ttd�td�d��}|j�dd��t!�ddg��}tj||j"dkD|�ddd�ycc}wcc}w#1swYyxYw)Nc�F��|j�fd|i|��t�|�S)N�key)�to_hdfr)r�obj�kwargs�paths   ��JC:\Python312\Lib\site-packages\pandas/tests/io/pytables/test_round_trip.py�	roundtripz'test_conv_read_write.<locals>.roundtrip!s(����C�J�J�t�/��/��/��D�#�&�&��
��dtype�
2020-01-01��periods��index�series�float64�i_�rr!�
string_series皙�����?�x����ABCDr*�i-��columnsr!�frame���A�B�tableT�r�appendzindex>2)�where�)�tm�ensure_cleanr�np�aranger#r�assert_series_equal�ranger�reshaper�list�object�assert_frame_equalrrr!)r�o�i�df�resultrs     @r�test_conv_read_writerHs{���	���	�8�d�	'�
��I�I�b��
�
�+�:�l�TV�3W�
��	���q�)�H�a�"8�9��5��9�I��b�	�5R�1��1�#�h�5R�S��
���q�)�O�Q�"?�@���"�)�)�C�.�(�(��1�1��$�v�,�f�5��5��9�5�a�2�a�S��5�V�D�
��
	���a��7�A�!6�7��U�1�X�E�!�H�5�
6��
�	�	�$�G�D�	�1��$��	�{�;��
���b����A��.��7�38�8��6S��6�#8�8�s,�A;G�G�A;G�G
�$BG�
G�Gc���dgdz}td|i|��}t|�5}|jd|dg��|jd�}t	j
||�ddd�y#1swYyxYw)N�2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar�ar rF)�data_columns)rrr7�selectr:rC)�
setup_path�datarF�storerGs     r�test_long_stringsrQ;sn���:��?�D�	�C��;�d�	+�B�	�J�	'�*�5�
���T�2�S�E��2����d�#��
���b�&�)�	*�*�*�s�=A'�'A0c���||z}ttd��}|jddj|ddd��|jddj|ddd��t	j
t
|d�|�|jddj|ddd��|jddj|ddd��t	j
t
|d�|�y)N�rrFTr5�rr7�formatF�rr?�ilocrr:rCr��tmp_pathrNrrFs    r�test_apirZGs����j� �D�	�5��9�	�B��G�G�C�R�L����$�t�G��D��G�G�B�C�L����$�t�G��D����(�4��.��3��G�G�C�R�L����$�u�W��E��G�G�B�C�L����$�t�G��D����(�4��.��3rc���||z}ttd��}|jddj|dd��|jddj|ddd��t	j
t
|d�|�|jddj|ddd��|jddj|dd��t	j
t
|d�|�y)	NrSrrFTr6r5rTFrVrXs    r�test_api_appendr\Ws����j� �D�	�5��9�	�B��G�G�C�R�L����$�t��4��G�G�B�C�L����$�t�G��D����(�4��.��3��G�G�C�R�L����$�u�W��E��G�G�B�C�L����$�t��4����(�4��.��3rc���||z}ttd��}|j|ddd��tjt|d�|�|j|ddd��tjt|d�|�|j|dd��tjt|d�|�|j|d��tjt|d�|�t
|�5}ttd��}t|d�|jd|jdd	d
d��|jd|jd	dd
d��tj|jd�|�t|d�|jd|jdd	dd��|jd|jd	dd
d��tj|jd�|�t|d�|jd|jdd	dd��|jd|jd	dd
d��tj|jd�|�t|d�|jd|jdd	dd��|jd|jd	dd
d��tj|jd�|�ddd�y#1swYyxYw)
NrSrFF�fixedrT�fr6)rrTr5)r7rU)rr?rr:rCrrr
r7rWrM)rYrNrrFrPs     r�
test_api_2r`esm���j� �D�	�5��9�	�B��I�I�d��U�7�I�;����(�4��.��3��I�I�d��U�3�I�7����(�4��.��3��I�I�d��U�I�+����(�4��.��3��I�I�d��I�����(�4��.��3�	�J�	'�6�5�
�u�R�y�
!���e�T�"�
���T�2�7�7�3�B�<��W��E�
���T�2�7�7�2�3�<��W��E�
���e�l�l�4�0�"�5�	�e�T�"�
���T�2�7�7�3�B�<��g��F�
���T�2�7�7�2�3�<��W��E�
���e�l�l�4�0�"�5�	�e�T�"�
���T�2�7�7�3�B�<��g��F�
���T�2�7�7�2�3�<��W��E�
���e�l�l�4�0�"�5��e�T�"�
���T�2�7�7�3�B�<��g��F�
���T�2�7�7�2�3�<��T��B�
���e�l�l�4�0�"�5�/6�6�6�s
�6G)K(�(K1c��||z}tdtjd�jd�zt	td�t��t	td�D�cgc]}d|����	c}t����}d	}tjt|�
�5|j|ddd
��ddd�tjt|�
�5|j|ddd��ddd�d}tjt|�
�5|j|ddd��ddd�tjt|�
�5|j|ddd��ddd�d}d|�d�}tjt|�
�5t|d�ddd�ycc}w#1swY��xYw#1swY��xYw#1swY��xYw#1swY�kxYw#1swYyxYw)Nr'r(r)r,rr*r-r.zCan only append to Tables��matchrFTr_rTr^z)invalid HDFStore format specified \[foo\]�fooF�zFile z does not exist)rr<r=r@rrArBr?�pytest�raises�
ValueErrorr�	TypeError�FileNotFoundErrorr)rYrNrrErF�msgs      r�test_api_invalidrl�s����j� �D�	��b�i�i��n�$�$�W�-�-��d�6�l�&�1��u�R�y�1�!�r�!��X�1��@�
�B�&�C�	���z��	-�;�
�	�	�$�D��c�	�:�;�
���z��	-�?�
�	�	�$�D��g�	�>�?�7�C�	���y��	,�=�
�	�	�$�D��e�	�<�=�
���y��	,�>�
�	�	�$�D��u�	�=�>��D��$���
'�C�	���(��	4����t�����/2�
;�;��?�?��
=�=��>�>����sB�F�F �F,�F8�G�
G� F)�,F5�8G�G
�Gc���t|�5}ttjdtj��tdd����|d<|j
d�}|d}tj||�|j
d�}|d}tj||�tjtd�	�5|j
d
�ddd�ddd�y#1swY�xYw#1swYyxYw)Nrrrrr rKz/az'No object named b in the file'rb�b)rrr<r=r#r�getr:r>rfrg�KeyError)rNrP�left�rights    r�test_getrs�s���	�J�	'�
�5���I�I�b��
�
�+�:�l�TV�3W�
��c�
��y�y��~���c�
��
���t�U�+��y�y�����d���
���t�U�+�
�]�]�8�+L�
M�	��I�I�c�N�	�
�
�	�	��
�
�s$�B2C-�>C!�C-�!C*	�&C-�-C6c��ttjjd�j	d��}t|tj|�y)Nr9)�2�d)rr<�random�default_rng�standard_normal�_check_roundtripr:rC)rNrFs  r�test_put_integerr{�s8��	�2�9�9�(�(��+�;�;�I�F�	G�B��R��.�.�
�;rc
���t|�5}tdgd�id��}|jd|�tj|j
|dj
�tdgd�id��}|jd|�tj|j
|dj
�t
jd�}tjt|�	�5|jd|�ddd�ttjd
gdgdggd
��dg��}|jd|�tj|j
|dj
�|j
jddk(sJ�tdD�cic]<}|ttjj!d�j#d�|����>c}�}d|d<d|d<|dj%d�|d<|ddkD|d<t'd�|d<t'd�|d<|jd|�|j)d�j
j+�}|j,D�cgc]
}t/|���c}|_tdd
d
d
d
d
d
d
dd�	d �!�}|j1�}|j1�}tj||�ddd�y#1swY���xYwcc}wcc}w#1swYyxYw)"NrK��r9��f8r�df_f8�i8�df_i8z�invalid combination of [values_axes] on appending data [name->values_block_0,cname->values_block_0,dtype->float64,kind->float,shape->(1, 3)] vs current table [name->values_block_0,cname->values_block_0,dtype->int64,kind->integer,shape->None]rbr~r9r�f4r3�r/�df_f4r�float32)r�r#�int32�int64�int16�int8r1rd�string��?�float322�bool�20130101�time1�20130102�time2�df_mixed_dtypes1)	r�r#r�r�r�r�r�rBzdatetime64[ns]�count)�name)rrr7r:r>�dtypes�re�escaperfrgrhr<�arrayrWrrwrx�integers�astyperrM�value_countsr!�str�
sort_index)	rNrP�df1�df2rk�crGrE�expecteds	         r�"test_table_values_dtypes_roundtripr��s���	�J�	'�=1�5���i�(��5��
���W�c�"�
���s�z�z�5��>�+@�+@�A���i�(��5��
���W�c�"�
���s�z�z�5��>�+@�+@�A��i�i�
�
���]�]�:�S�
1�	'��L�L��#�&�	'�
����1�#��s�Q�C���=��u�M��
���W�c�"�
���s�z�z�5��>�+@�+@�A��z�z���q�!�Y�.�.�.��S�
���6�"�)�)�/�/��2�;�;�A�>�a�H�H�
�
����H�
���J���j�/�0�0��;��J���)�n�q�(��F�� ��,��G�� ��,��G��
���'��-����0�1�8�8�E�E�G��(.���5�1��A��5������������"#�

��

���"�"�$���&�&�(��
���v�x�0�{=1�=1�$	'�	'��
��6�Y=1�=1�s@�CK'�K�0BK'�AK
�BK'� K"�2AK'�K	�K'�'K0z(ignore::pandas.errors.PerformanceWarningc	��ttd�dtd�D�cgc]}d|����	c}��}t|tj|��ttjdt
j��tdd���	�}t|tj|��t|jt|jt���}t|tj|��t|jttj|jt��t���}t|tj|d
��ycc}w)Nrr#r$r%�rrrrr F)r�check_index_type)rr?rzr:r>r<r=r#rr!rrB�values�asarray)rNrE�s�ts�ts2�ts3s      r�test_seriesr�s����u�R�y�	�E�"�I�1N�q�B�q�c�(�1N�O�A��Q��.�.�Z�@�	�
�	�	�"�B�J�J�'�z�,�PR�/S�
�B��R��/�/�j�A�
����5�����8�
9�C��S�"�0�0�z�B�
����E�"�*�*�R�X�X�V�"D�F�S�
T�C���R�
#�
#�*�u���2Os�Ec�
�tjjd�jd�}t	tjjd�jd�|��}t|tj|��y)Nr9rr r�)r<rwrxryrrzr:r>)rNr!r�s   r�test_float_indexr�sY���I�I�!�!�!�$�4�4�R�8�E��r�y�y�$�$�Q�'�7�7��;�5�I�A��Q��.�.�Z�@rc��tjd�}gd�}tjjd�j	d�jd�}t
|||��}tjtjj�5t|tj|��ddd�y#1swYyxYw)Nr))gr�)�@�@)g@g@r9r*)rr)r!r/r�)r<r=rwrxryr@rr:�assert_produces_warning�pd�errors�PerformanceWarningrzrC)rN�col�idxrO�DFs     r�test_tuple_indexr�"s���
�)�)�B�-�C�
.�C�
�9�9� � ��#�3�3�B�7�?�?��H�D�	�4�s�C�	0�B�	�	#�	#�B�I�I�$@�$@�	A�E���R�2�2��D�E�E�E�s�B8�8Cc�^�tjjd�jd�}d�}t	|ddg�}t|||��t	|tjj�dg�}t|||��t	|ddg�}t|||��t	|tjj�dg�}t|||��t	|ddg�}t|||��t	|tjj�dg�}t|||��t	|ddg�}t|||��t	|tjj�dg�}t|||��t	|ddg�}t|||��t	|d	d
g�}t|||��t	|d	dg�}t|||��tdd
gd��}t	||��}t|||��|jjd�|_
t|||��y)Nr9c�2�tj||d��S)NT)r�)r:r>)�lhs�rhss  r�<lambda>z"test_index_types.<locals>.<lambda>1s��B�2�2�3��d�S�rr�yr�rKg�G�z��?rnr~g{�G�z�?r1z
2012-01-01z
2012-01-02�M8[ns]rr r�)r<rwrxryrrz�datetime�today�daterr!�as_unit)rNr��func�ser�dtis     r�test_index_typesr�-s���
�Y�Y�
"�
"�1�
%�
5�
5�a�
8�F�S�D�
��!�S��
"�C��S�$�Z�0�
��(�+�+�1�1�3�Q�7�
8�C��S�$�Z�0�
��#�q��
"�C��S�$�Z�0�
��(�-�-�-�-�/��5�
6�C��S�$�Z�0�
��!�S��
"�C��S�$�Z�0�
��(�+�+�1�1�3�Q�7�
8�C��S�$�Z�0�
��#�q��
"�C��S�$�Z�0�
��(�-�-�-�-�/��5�
6�C��S�$�Z�0�
��$���
%�C��S�$�Z�0�
��!�T��
#�C��S�$�Z�0�
��!�Q��
 �C��S�$�Z�0�
��|�4�H�
E�C�
��s�
#�C��S�$�Z�0��	�	�!�!�#�&�C�I��S�$�Z�0rc�f�tdd�}ttjj	d�jt
|��|��}	t|tj|��y#t$r:t�r.|jtjjd���wxYw)Nz1/1/1940z1/1/1960r9r r�z'known failure on some windows platforms)r
rr<rwrxry�lenrzr:r>�
OverflowErrorr�applymarkerrf�mark�xfail)rN�request�drr�s    r�test_timeseries_preepochr�\s���	�Z��	,�B�	��	�	�%�%�a�(�8�8��R��A��	L�B����R�3�3�*�E����� �������!�!�"K�L�
�	��s
�A-�-AB0�compressionFT)�marksc��tdtjd�jd�zt	td�t��t	td�D�cgc]}d|����	c}t����}tj|jd	<tj|jd
<t|tj||��t|tj||��ttjjd�j!d
�t	td�t��t#ddd����}t|tj||��t%|�5}tjjd�j!t'|��|d<||d<|d}|j(j+�sJ�	ddd�t|ddtj|��ycc}w#1swY�.xYw)Nr'r(r)r,rr*r-r.)rr)r1r�rr�r9)rr+z
2000-01-01rr4)r�freqrdrFrr�)rr<r=r@rrArBr?�nanrW�_check_roundtrip_tabler:rCrzrwrxryrrr��_mgr�is_consolidated)r�rNrErF�tdfrP�reconss       r�
test_framer�is���
��b�i�i��n�$�$�W�-�-��d�6�l�&�1��u�R�y�1�!�r�!��X�1��@�
�B��F�F�B�G�G�D�M��F�F�B�G�G�D�M��
�B�!�!�
����
�B�!�!�
����
�	�	���a� �0�0��9��d�6�l�&�1���r��<��C�
��R�
"�
"����
�J�	'�-�5��I�I�)�)�!�,�<�<�S��W�E��5�	���d���t����{�{�*�*�,�,�,�-��R���V�R�2�2��D��?2�.-�-�s�G9�/A!G>�>Hc��tt��}tdt��}t�}tgd���}tgd���}t|tj
|��t|tj
|��t|tj|��t|tj|��t|tj|��y)	Nr�myseries)r�r�rKrnr�r )�d�er_r�r�)rrBrrzr:r>rC)rN�s0�s1�df0r�r�s      r�test_empty_series_framer��s���	�f�	�B�	�Z�v�	.�B�
�+�C�
�/�
*�C�
�O�
,�C��R��/�/�j�A��R��/�/�j�A��S�"�/�/�j�A��S�"�/�/�j�A��S�"�/�/�j�Arrzm8[ns]r�c�T�t|��}t|tj|��y)Nrr�)rrzr:r>)rrNr�s   r�test_empty_seriesr��s���U��A��Q��.�.�Z�@rc��tdd�D�cgc]}|j���}}ttjjd�j
t|�df�|��}t|tj|��ycc}w)Nz1/1/2000z	1/30/2000r9r+r r�)r
r�rr<rwrxryr�rzr:rC)rN�x�rngr0s    r�test_can_serialize_datesr��sm��(��[�A�
B��1�6�6�8�
B�C�
B��
�	�	���a� �0�0�#�c�(�A��?�s�
�E��U�B�1�1�
�C��Cs�B	c�J�|}t|tj|��t|jtj|��t|dtj|��t|�5}||d<|d}tj||�ddd�y#1swYyxYw)Nr�r3r0)rzr:rC�Tr>r)rN� multiindex_dataframe_random_datar0rPr�s     r�test_store_hierarchicalr��s���,�E��U�B�1�1�
�C��U�W�W�b�3�3�*�E��U�3�Z��!7�!7�j�I�
�J�	'�-�5���g���w���
���f�e�,�-�-�-�s�/!B�B"c��d�}|�}|�}t|tj|��t|tj|��t|�5}||d<tj|d|�||d<tj|d|�ddd�t|dtj||��t|dtj||��t|dtj||��y#1swY�jxYw)Nc�h�tdtjd�jd�zt	td�t��t	td�D�cgc]}d|����	c}t����}d	|d
<d|d<|d
dkD|d<|ddkD|d<d|d<d|d<|j�Scc}w)Nr'r(r)r,rr*r-r.rd�obj1�bar�obj2r3r�bool1r4�bool2r~�int1r9�int2)	rr<r=r@rrArBr?�_consolidate)rErFs  r�	_make_onez#test_store_mixed.<locals>._make_one�s���
��"�)�)�C�.�(�(��1�1��$�v�,�f�5��5��9�5�a�2�a�S��5�V�D�
��
��6�
���6�
���g��k��7����g��k��7����6�
���6�
���� � ��6s�B/r�rr�r�r�r�)rzr:rCrr>)r�rNr�r�r�rPs      r�test_store_mixedr��s���!��+�C�
�+�C��S�"�/�/�j�A��S�"�/�/�j�A�	�J�	'�1�5���e��
���e�E�l�C�0���e��
���e�E�l�C�0�	1���F��
���
��	���G��
���
��	���F��
���
��	�'1�1�s�=C;�;Dc��i}|rd|d<t|dfi|��5}||d<|d}|||fi|��ddd�y#1swYyxYw)N�blosc�complib�wr)r)r�
comparatorrr�r�optionsrP�	retrieveds        rrzrz�s[���G��$��	��	�D�#�	1��	1�-�U���e���%�L�	��9�c�,�V�,�-�-�-�s�5�>c��i}|rd|d<t|dfi|��5}|jd|d��|d}|||�ddd�y#1swYyxYw)Nrrrrr5)rU)r�put)rrrr�rrPrs       rr�r��s_���G��$��	��	�D�#�	1��	1�#�U�
�	�	�%��W�	�-��%�L�	��9�c�"�	#�#�#�s�#A�Ac���ddg}ttjjd�j	t|��|�}t
|tj|��y)Nuσuσσr9r�)	rr<rwrxryr�rzr:r>)rN�unicode_valuesr�s   r�test_unicode_indexr
sO����/�N��
�	�	���a� �0�0��^�1D�E��	�A��Q��.�.�Z�@rc��d}td|gi�}t|�5}|jd|dd��|jd�}t	j
||�ddd�td|gddgd	��}t|�5}|jd|dd��|jd�}t	j
||�ddd�y#1swY�lxYw#1swYyxYw)
NuΔr3rFr5zutf-8)rU�encodingrKrnr2)rrrror:rC)rN�charrFrPrGs     r�test_unicode_longer_encodedrs����D�	�C�$��=�	!�B�	�J�	'�*�5�
�	�	�$��7�W�	�=����4���
���f�b�)�*�

�#�t��C��:�6�	7�B�	�J�	'�*�5�
�	�	�$��7�W�	�=����4���
���f�b�)�*�*�
*�*��*�*�s�=C�>=C�C
�Cc��tgd�gd�gd�d��}ttjdtj��tdd����}|jdd	|d
<t|tj|��y)Nr})r�r�r�r�rrrrr rr�r�)
rrr<r=r#rr!rzr:rC)rNrFr�s   r�test_store_datetime_mixedr!s`��	����O�	P�B�	�
�	�	�"�B�J�J�'�z�,�PR�/S�
�B��h�h�r��l�B�s�G��R��.�.�Z�@rc���tddgddgd��}||z}|j|dd��t|d�}tj||�|j|�sJ�|j|�sJ�y)	Nr~r9r�r�)r4r3rFr5�rrU)rrrr:rC�equals)rYrNrFr�others     r�test_round_trip_equalsr*su��	�!�Q��s�C�j�1�	2�B��j� �D��I�I�d��W�I�-��T�4� �E����"�e�$�
�9�9�U�����<�<����rc
��tjd�||z}tjdd�5t	dtd�tt
d����jdd	g�}|j�}|j|d
d��t|d
�}tj||�ddd�y#1swYyxYw)
N�pyarrowzfuture.infer_stringTr~r,rr.r3r4rFr5r)
rf�importorskipr��option_contextrrAr?�	set_index�copyrrr:rC)rYrNrrFr�rGs      r�test_infer_string_columnsr6s���
���	�"��j� �D�	�	�	�0�$�	7�0�
�q�$�v�,�d�5��9�o�
F�
P�
P�
�#�J�
���7�7�9��
�	�	�$�D��	�1��$��%��
���f�h�/�0�0�0�s�BB;�;C)F)?r�r��numpyr<rf�pandas._libs.tslibsr�
pandas.compatr�pandasr�rrrrr	r:r
rr�pandas.tests.io.pytables.commonr
r�pandas.utilr�tdr��
single_cpu�
pytestmarkrHrQrZr\r`rlrsr{r��filterwarningsr�r�r�r�r��parametrize�param�skip_if_windowsr�r�r�r#rBr�r�r�r�rzr�r
rrrr�rr�<module>r+s����	��
�)�-��	�	�	��/�
�[�[�
#�
#�
�8�:	*�
4� 4�'6�T�B�"<�>1�B�����F�G��H��$A�E������F�G�+1�H�+1�\
�������E�<�6�<�<��B�4F�4F�G�H��#E��#E�LB�������2�8�8�R�Z�Z���8�"T�U�A�V�A�
D�-�������E�<�6�<�<��B�4F�4F�G�H��-��-�`-�	#�A�
*� A�	�0r

Youez - 2016 - github.com/yon3zu
LinuXploit