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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

0	�g����N�dZddlmZddlZddlZddlZddlmZddlm	cm
Zddlm
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZddlmZddlm Z ddl!m"Z"ejFd�Z$Gd	�d
�Z%Gd�d�Z&Gd
�d�Z'Gd�d�Z(Gd�d�Z)Gd�d�Z*y)z* test positional based indexing with iloc �)�datetimeN)�
IndexingError)�NA�Categorical�CategoricalDtype�	DataFrame�Index�Interval�NaT�Series�	Timestamp�array�concat�
date_range�interval_range�isna�to_datetime)�	is_scalar)�"check_indexing_smoketest_or_raiseszuonly integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indicesc���eZdZejjdddgd�g�ejjdddg�ejjdgd	��d
����Zy)�TestiLoc�key�����r�r�kind�series�frame�col)�labels�mixed�ts�floats�emptyc�V�|j|�d|���}t|d|t��y)N�_�iloc)�fails)�getfixturevaluer�
IndexError)�selfrrr �request�objs      �AC:\Python312\Lib\site-packages\pandas/tests/indexing/test_iloc.py�"test_iloc_getitem_int_and_list_intz+TestiLoc.test_iloc_getitem_int_and_list_int)s2���%�%���a��u�o�6��*�����		
�N)�__name__�
__module__�__qualname__�pytest�mark�parametrizer0�r1r/rr(sg���[�[���U�Q��I�$6�7��[�[���V�h��%8�9��[�[���
�4��
�	�:�8�
r1rc��eZdZdZej
j
ded�ed�ed�gd�e	ed��e
jgd��g�ej
j
dejejg�d���Zej
j
deeg�d	��Zd
�Zd�Zej
j
de
j*d
�ed�fg�ej
j
ded�ddggddged�feddd�ged�fg�d���Zd�Zd�Zd�Zd�Zd�Zd�Zej
j
dddggd �g�d!��Zd"�Z d#�Z!d$�Z"d%�Z#d&�Z$d'�Z%d(�Z&d)�Z'd*�Z(d+�Z)d,�Z*d-�Z+d.�Z,ej
j
dd/geddd�e
j d/g�g�ej
j
d0d1ge
j d1g�g�d2���Z-ej
j]d3�d4��Z/d5�Z0d6�Z1d7�Z2d8�Z3d9�Z4d:�Z5d;�Z6d<�Z7d=�Z8ej
j
d0de9e
jtg�d>��Z;ej
j
d?e<d/d�d@dAg�dB��Z=dC�Z>ej
j
dejejg�dD��Z?dE�Z@dF�ZAej
j
dGee
j g�dH��ZBej
j
ddgeddI�g�dJ��ZCdK�ZDdL�ZEdM�ZFdN�ZGdO�ZHdP�ZIej
j
dQee
j g�ej
j
dRee
j g�dS���ZJdT�ZKdU�ZLeMj�dV��ZOdW�ZPy)X�TestiLocBaseIndependentzTests Independent Of Base ClassrN�r�indexerc�(�tdtd�it��}tgd��}|s*|jj
dj
|�sJ�|j�}|j}|||�|df<td|i�jt�}|s%tj|dj|�sJ�tj||�d|jd<|ddk7sJ�ttjgd�t��td�d��}|j�}|||�|df<tt!|jt�t��td�d��}tj||�y)	Nrr;��dtype)�alpha�beta�gammarB�rrr�rr)r�range�objectr�_mgr�blocks�_can_hold_element�copy�values�astype�np�
shares_memory�tm�assert_frame_equalr(rr)	r,r<r�using_array_managerr�cat�df�	orig_vals�expecteds	         r/�%test_iloc_setitem_fullcol_categoricalz=TestiLocBaseIndependent.test_iloc_setitem_fullcol_categorical?sK���1�e�A�h�-�v�6���4�5��"��:�:�$�$�Q�'�9�9�#�>�>�>�
�Z�Z�\���I�I�	�!����C��F���a��X�&�-�-�f�5��"��#�#�B�q�E�L�L�)�<�<�<�
���b�(�+� �����
��1�v�� � � �
�b�h�h�y��?�E�!�H�M�N��
�Z�Z�\��!����C��F�����
�
�6�(:�&�!I�e�TU�h�W�X��
���b�(�+r1�boxc�r�tgd��}||jd��}|tur
|j}n|jj
d}|tur||dd�|jddn||dd�|jdd�df<|tjgd�d���}tj||�|turF|r2|j|usJ�tj|j|�sJ�|j|usJ�yytj|dj|�sJ�y)N�rrr;��i8rr)r;rZr;rZr>)r�to_numpyrrKrG�arraysr(rMrO�assert_equalrN)r,�frame_or_seriesrW�using_copy_on_write�arrr.rKrUs        r/�test_iloc_setitem_ea_inplacez4TestiLocBaseIndependent.test_iloc_setitem_ea_inplaceks���L�!���c�l�l�4�0�1���f�$��Z�Z�F��X�X�_�_�Q�'�F��f�$��s�1�2�w�<�C�H�H�R�a�L�!�#�a�b�'�l�C�H�H�R�a�R��U�O�"�2�8�8�L��#E�F��
����X�&��f�$�"��z�z��/�/�/��'�'��
�
�F�;�;�;��z�z�V�+�+�+�<��#�#�C��F�M�M�6�:�:�:r1c���tgd��}ttd�|��}|jj	d�sJ�|j�}|jj	d�sJ�y)N)rrrr;��index)r�rr)r	rrEr(�_is_scalar_access�to_frame)r,re�serrSs    r/�test_is_scalar_accessz-TestiLocBaseIndependent.test_is_scalar_access�sW���i� ���U�1�X�U�+���x�x�)�)�$�/�/�/�
�\�\�^���w�w�(�(��0�0�0r1c
�(�ttjjd�jd�t	d���}d}tjt|��5|jdd�gd�fddd�tjt|��5|jdd	gddd�tjt|��5|jdd
gddd�tjt|��5|jdgddd�|d}tjt|��5|jdgddd�tjt|��5|jd
gddd�d}tjt|��5|jd	ddd�tjt|��5|jd
ddd�tjt|��5|jd	ddd�tjt|��5|jd
ddd�|jdd�dd�f}|jdd�dd�f}tj||�|jdd�dd�f}|jdd�dd�f}tj||�|jdd�ddd�f}|jdd�ddd�f}tj||�|jdd�ddd�f}|jdd�ddd�f}tj||�|jdd�dd�f}|jdd�dd�f}tj||�|jdd�dd�f}|jdd�dd�f}tj||�|jdd�ddd�f}|jdd�dd�f}tj||�|jdd�dd�f}|jdd�dd�f}tj||�|jdd	}|jdd}tj||�|jd	d}|jdd}tj||�|jd	dd�}|jddd�}tj||�ttjjd�jd�t	d���}tj|jdd�dd�ft|jtg|jj �����tj|jdd�dd�f|jdd�dgf�tj|jdd|jdg�d}tjt|��5|jgd�ddd�d}tjt|��5|jdd�dfddd�y#1swY��xYw#1swY���xYw#1swY���xYw#1swY���xYw#1swY��cxYw#1swY��<xYw#1swY��xYw#1swY���xYw#1swY���xYw#1swY���xYw#1swY��xYw#1swYyxYw)Nr)���ABCDE��columnsz%positional indexers are out-of-bounds��match�rrrr;rZrmr�i���d�Ai����z*single positional indexer is out-of-boundsrZ�
���i����rri�������rmr�ABr;r>�rerp��rZrmr~)rrM�random�default_rng�listr5�raisesr+r(rOrP�assert_series_equal�standard_normalrer	rpr?)r,rS�msg�s�resultrU�dfls       r/�test_iloc_exceeds_boundsz0TestiLocBaseIndependent.test_iloc_exceeds_bounds�s����r�y�y�,�,�Q�/�6�6�w�?��g��
W��6��
�]�]�:�S�
1�	+��G�G�A�)�)�*�	+�
�]�]�:�S�
1�	��G�G�Q��G��	�
�]�]�:�S�
1�	��G�G�Q��H��	�
�]�]�:�S�
1�	��G�G�S�E�N�	�
�s�G��
�]�]�:�S�
1�	�
�F�F�C�5�M�	�
�]�]�:�S�
1�	�
�F�F�D�6�N�	�;��
�]�]�:�S�
1�	��G�G�B�K�	�
�]�]�:�S�
1�	��G�G�C�L�	��]�]�:�S�
1�	�
�F�F�2�J�	�
�]�]�:�S�
1�	�
�F�F�3�K�	�����A�b�D��!���7�7�1�a�b�5�>��
���f�h�/�����B�s�F��#���7�7�1�b�q�b�5�>��
���f�h�/�����B�q��G��$���7�7�1�e�q��e�8�$��
���f�h�/�����A�c�"�H��%���7�7�1�a�e��e�8�$��
���f�h�/�����C��E��"���7�7�1�b�q�b�5�>��
���f�h�/�����B�q�D��!���7�7�1�b�q�b�5�>��
���f�h�/�����C��B�J��'���7�7�1�b�q�b�5�>��
���f�h�/�����B�r�E��"���7�7�1�b�q�b�5�>��
���f�h�/�����2����6�6�"�#�;��
���v�x�0���������6�6�"�1�:��
���v�x�0������B�����6�6�$�B�$�<��
���v�x�0���I�I�!�!�!�$�4�4�V�<�d�4�j�
��	����H�H�Q��!��V���C�I�I�u�R�s�{�{�?P�?P�/Q�R�	
�	���c�h�h�q�!�A�#�v�.�����Q�C��0@�A�
���c�h�h�q��m�S�X�X�q�c�]�;�5��
�]�]�:�S�
1�	 ��H�H�Y��	 �:��
�]�]�:�S�
1�	��H�H�Q��T�N�	�	�w	+�	+��	�	��	�	��	�	��	�	��	�	��
	�	��	�	��	�	��	�	��z	 �	 ��	�	�s�� Y:�Z�Z�Z!�<Z.�0Z;�&[�[�["�?[/�&[<�\�:Z�Z�Z�!Z+�.Z8�;[�[�[�"[,�/[9�<\�\z
index,columnsrlrnzindex_vals,column_valsrv�D�1�2i�rc�&�ttjjd�j	t|�t|�f�||��}d}t
jt|��5|j||fddd�y#1swYyxYw)Nrr}z$.iloc requires numeric indexers, gotrq)
rrMr�r�r��lenr5r�r+r()r,rerp�
index_vals�column_valsrSr�s       r/�test_iloc_non_integer_raisesz4TestiLocBaseIndependent.test_iloc_non_integer_raises�sy����I�I�!�!�!�$�4�4�c�%�j�#�g�,�5O�P���
��
5��
�]�]�:�S�
1�	-��G�G�J��+�,�	-�	-�	-�s�,B�Bc�
�ttjd�jdd��}t	j
||�}t
jtd��5|jdddd�y#1swYyxYw)NrurwzCannot index by location indexrq�a)
rrM�arange�reshaperO�get_objr5r��	TypeErrorr()r,r_r.s   r/� test_iloc_getitem_invalid_scalarz8TestiLocBaseIndependent.test_iloc_getitem_invalid_scalarsb����	�	�#��.�.�r�2�6�7���j�j��o�.��
�]�]�9�,L�
M�	��H�H�S�M�	�	�	�s� A9�9Bc� �tjgd��}|j�}tgd�gd�gd�d�gd���}|j|tj||�|jdd�|ftj||�y)N)rrr)ru�e�f)�g�h�i)�j�k�l�rv�B�C�rrr;rd)rMrrJrr(rO�assert_numpy_array_equal)r,�array_with_neg_numbers�
array_copyrSs    r/�-test_iloc_array_not_mutating_negative_indiceszETestiLocBaseIndependent.test_iloc_array_not_mutating_negative_indicessy��!#���*�!5��+�0�0�2�
�
�!��o�N��
��	���&�'�
�#�#�$:�J�G�
����)�)�*�
�#�#�$:�J�Gr1c�&�tgd�gd�d��}|d}|jd}|jd}tj||�|jdg}|jdg}tj||�|jd}|jd}||k(sJ�|jdg}|jdg}tj||�tdgdg��}|jd	g}tj||�y)
N)rr;rm)�ry�
�rvr�rvr���r�rdr)rr(rOr�rPr)r,rSr�rUr�s     r/�/test_iloc_getitem_neg_int_can_reach_first_indexzGTestiLocBaseIndependent.test_iloc_getitem_neg_int_can_reach_first_index"s����Y�[�9�
:���s�G���7�7�1�:��������
���v�x�0��7�7�A�3�<�����"����
���f�h�/��6�6�!�9����������!�!�!��6�6�1�#�;���������
���v�x�0��3�%��u�-������t�$��
���v�x�0r1c�<�tddd�ddd�g�}tddd�ddd�g�}t||gd��}|jd}t|�sJ�|jddd�f}t	t
jdddggd	�d�
�}tj||�y)Nrr�rr;rZ��axisrCr�rvr�rvr�)re�name)	rrr(rrrM�nanrOr�)r,�df1�df2rSr�rUs      r/�test_iloc_getitem_dupsz.TestiLocBaseIndependent.test_iloc_getitem_dups=s����t�!�,�A�A�.>�?�@���q�q�)���+;�<�=��
�S�#�J�Q�
'���������F�|��|�����A�����2�6�6�1�a��+�3G�a�P��
���v�x�0r1c��tdddd�dddd�dd	d
d�g�}tdddd�g�}tj|jdg|�tdddd�dddd�g�}tj|jddg|�tddd�d	d
d�gddg�
�}|jddgddgf}tj||�y)Nrrr;r�ru���,�����r)r�r�rd)rrOrPr(�r,rSrUr�s    r/�test_iloc_getitem_arrayz/TestiLocBaseIndependent.test_iloc_getitem_arrayKs���
��a�a�(���#�.���D�1�
�
���A�A�A�6�7�8��
���b�g�g�q�c�l�H�5��A�A�A�6�c��RU�8V�W�X��
���b�g�g�q�!�f�o�x�8��A�A�.�d��0F�G�PQ�ST�v�V�����!�Q��!�Q���(��
���f�h�/r1c�.�tdddd�dddd�dd	d
d�g�}tdddd�dddd�g�}|jgd�}tj||�tdddd�dd	d
d�gddg�
�}|jd�}tj||�y)Nrrr;r�rur�r�r�r�r�)TTFrrdc�&�|jdzdk(S)Nrrrd��xs r/�<lambda>z@TestiLocBaseIndependent.test_iloc_getitem_bool.<locals>.<lambda>ns��1�7�7�Q�;�!�#3�r1�rr(rOrPr�s    r/�test_iloc_getitem_boolz.TestiLocBaseIndependent.test_iloc_getitem_bool^s���
��a�a�(���#�.���D�1�
�
���A�A�A�6�c��RU�8V�W�X�����,�-��
���f�h�/���1�1�
%�T��4�'H�I�RS�UV�QW�
�����3�4��
���f�h�/r1reTF)TFTFc���tgd��}dt|��dt|���}tjt|��5|j
|ddd�y#1swYyxYw)Nr�z Boolean index has wrong length: z instead of rq)rr�r5r�r+r()r,rer�r�s    r/�test_iloc_getitem_bool_diff_lenz7TestiLocBaseIndependent.test_iloc_getitem_bool_diff_lenqsV��
�9���0��U���L��Q���Q��
�]�]�:�S�
1�	�
�F�F�5�M�	�	�	�s�A�A%c��tdddd�dddd�dd	d
d�g�}tdddd�dddd�g�}|jdd}tj||�tddd�gdg��}|jdd�d
d�f}tj||�tddd�ddd�dd
d�g�}|jdd�d�f}tj||�y)Nrrr;r�rur�r�r�r�r�r�rdr)rvr�c�
�ddgS)Nrrr8)rSs r/r�zATestiLocBaseIndependent.test_iloc_getitem_slice.<locals>.<lambda>�s
���1�v�r1r�r�s    r/�test_iloc_getitem_slicez/TestiLocBaseIndependent.test_iloc_getitem_sliceys���
��a�a�(���#�.���D�1�
�
���A�A�A�6�c��RU�8V�W�X������!���
���f�h�/��C�c�2�3�A�3�?������1��a��c��"��
���f�h�/���1�
�S�s�3�4�d�5K�L�
������-�-�.��
���f�h�/r1c��ttjjd�j	d�gd���}ttjjd�jddd��j
dd�d	d
g��}t||gd��}tj|jdd�dd
�f|�tj|jdd�d
d�f|�t||gd��}tj|jdd�dd�f|�tj|jdd�dd�f|�t||jdd�dgfgd��}tj|jdd�dd�f|�t||gd��}tj|jdd�dd�f|�tj|jdd�dd�f|�tj|jdd�dd�f|�tj|jdd�dd�f|�y)Nr�rwrZ)rvrvr�r�rorrwrl��sizervr�rr�rZr;)rrMr�r�r��integersr�rrOrPr()r,r�r�rS�exps     r/�test_iloc_getitem_slice_dupsz4TestiLocBaseIndependent.test_iloc_getitem_slice_dups�s�����I�I�!�!�!�$�4�4�W�=�(�
����I�I�!�!�!�$�-�-�a��"�-�=�E�E�b�!�L��#�J�
���S�#�J�Q�
'��
���b�g�g�a��!��e�n�c�2�
���b�g�g�a���e�n�c�2�
�S�#�J�Q�
'��
���b�g�g�a��!��e�n�c�2�
���b�g�g�a���e�n�c�2��c�3�8�8�A��s�F�+�,�1�5��
���b�g�g�a��1��f�o�s�3��R��H�1�
%��
���b�g�g�a��d�B�Q�B�h�/��5�
���b�g�g�a��d�A�B�h�/��5�
���b�g�g�b�c�2�A�2�g�.��4�
���b�g�g�b�c�1�2�g�.��4r1c	�\�ttjjd�j	d�tj
ddd�tj
ddd���}d|jd	<|jd	}|dk(sJ�d|jdd�dd�f<|jdd�dd�f}|jdd�dd�f}tj||�tdgd
���}|jddxxxdz
ccctgd�gd
���}tj||�y)
Nr�rZrZr��r;r}r�rrrrd�rrr)rrMr�r�r�r�r(rOrPrr�)r,�warn_copy_on_writerSr�rUr�s      r/�test_iloc_setitemz)TestiLocBaseIndependent.test_iloc_setitem�s���
��I�I�!�!�!�$�4�4�V�<��)�)�A�q�!�$��I�I�a��Q�'�
�������
���������{��{������1�Q�3����7�7�1�a��c�6�?������A�a�C����
���f�h�/�
�1�I�&��	���q���q����)�9�5��
���q�(�+r1c�(�tgd�gd�gd�g�}|djt�|d<tgd�gd�gd�g�}|djt�|d<d|jd��d	<t	j
||�tgd�gd�gd�g�}|djt�|d<tgd
�gd�gd�g�}|djt�|d<d|jd��d	<t	j
||�y)
N)r~�crw)r��dry)r��er�r)rmrmrmrmrr�r)r~r�rm)r�r�rm)r�r�rm)rrLrFr(rOrP�r,rSrUs   r/�test_iloc_setitem_axis_argumentz7TestiLocBaseIndependent.test_iloc_setitem_axis_argument�s���
��l�L�A�
B���1����V�$��1���l�L�)�D�E���q�k�(�(��0��������Q�����
���b�(�+�
��l�L�A�
B���1����V�$��1���k�;��D�E���q�k�(�(��0��������Q�����
���b�(�+r1c�h�ttjd�jd�gd�gd���}|jddgddgf|jddgddgfxxdz
cc<ttj
gd	��jd�gd�gd���}t
j||�y)
N�	�r;r;r�r}rrrru)	rr�r�r;r�r�r~r�r�)rrMr�r�r(rrOrPr�s   r/�test_iloc_setitem_listz.TestiLocBaseIndependent.test_iloc_setitem_list�s���
��I�I�a�L� � ��(���
��	����A���A����
����A���A����3�&����H�H�8�9�A�A�&�I�!�#�
��
	���b�(�+r1c�@�tgd��}tgd��}|j�}ddg|jtddg�<tj||�|j�}ddg|jtddg�<tj||�y)N)rrrr;)rr���r;rr�rr)rrJr(rOr�r	)r,�s_origrUr�s    r/�test_iloc_setitem_pandas_objectz7TestiLocBaseIndependent.test_iloc_setitem_pandas_object�s�����%���.�)���K�K�M��"$�b�����v�q�!�f�~��
���q�(�+��K�K�M��!#�R�����u�a��V�}��
���q�(�+r1c�V�tddd�ddd�g�}tddd�ddd�g�}t||gd��}|jd�}tj|j
dd�df�}||j}|j
|df|j
|df<tj||�tddgddgd��}d	d	g|_	|d
=tj||�|j
ddgddgf|j
ddgddgf<tj||�|j
ddgddgfjd��|j
ddgddgf<|j
ddgddgfjd��|j
ddgddgf<tj||�y)
Nrr�rr;rZr�rrDr�rvT)�drop)rr�fillnarM�isnanr(rerOrPrp�reset_index)r,r�r�rSrU�inds�masks       r/�test_iloc_setitem_dupsz.TestiLocBaseIndependent.test_iloc_setitem_dups�s����t�!�,�A�A�.>�?�@���q�q�)���+;�<�=��
�S�#�J�Q�
'���9�9�Q�<���x�x�����1��
�&���D�z�����7�7�4��7�+�����a���
���b�(�+��!�Q��Q��F�3�4����:����s�G�
���b�(�+�#%�'�'�1�a�&�1�a�&�.�"9�����A���A����
���b�(�+�#%�'�'�1�a�&�1�a�&�.�"9�"E�"E�4�"E�"P�����A���A����"$�'�'�1�a�&�1�a�&�.�"9�"E�"E�4�"E�"P�����A���A����
���b�(�+r1c�v�tddgddggddg��}|jdd�dfjd�|jdd�df<|s$t|jj
�dk(sJ�t
jtd�	�5|jdd�dfd
z|jdd�df<ddd�|s$t|jj
�dk(sJ�|j�}|jddgddgf|jddgddgf<t
j||�y#1swY�~xYw)Nrrrr;r�ro�f8�incompatible dtyperqg�?)rr(rLr�rGrHrO�assert_produces_warning�
FutureWarningrJrP)r,rQrSrUs    r/�9test_iloc_setitem_frame_duplicate_columns_multiple_blockszQTestiLocBaseIndependent.test_iloc_setitem_frame_duplicate_columns_multiple_blockss��
��A���A��'�#�s��
<������1��
�,�,�T�2�����1��
�"��r�w�w�~�~�&�!�+�+�+��
'�
'�
�=Q�
R�	0��G�G�A�q�D�M�C�/�B�G�G�A�q�D�M�	0�"��r�w�w�~�~�&�!�+�+�+��7�7�9��#%�'�'�1�a�&�1�a�&�.�"9�����A���A����
���b�(�+�	0�	0�s�
(D/�/D8c	���ttjjd�j	d�tddd�tddd���}|jd}|jd}tj||�|jd}|jd	}||k(sJ�|jdd}|jdd
}tj||�|jdd�dd�f}|jdd�dd�f}tj||�|jgd
�}|jgd�}tj||�|jgd
�ddgf}|jgd�ddgf}tj||�|jgd�ddgf}|jgd�ddgf}tj||�|jgd�ddgf}|jgd�ddgf}tj||�ttdd�t��}|j|j}|jgd�}tj||�y)Nrr�rrlr�r}rZ)rrr��r;rm)rrr;)rrr~r)rrr;r)rzrr~r~)rrrr;)rzrzrr~)rer?)rrZr~r�)rrMr�r�r�rEr(�locrOr�rPrrFre)r,rSr�r�rUr�s      r/�test_iloc_getitem_framez/TestiLocBaseIndependent.test_iloc_getitem_frame(s+��
��I�I�!�!�!�$�4�4�W�=���2�q�/��!�Q��N�
���������f�f�Q�i��
���v�s�+��������f�f�T�l����}��}�����1����6�6�!�B�<��
���f�h�/�����A�a�C�����6�6�!�Q�q�S�&�>��
���f�h�/�����#���6�6�)�$��
���f�h�/�����Q��F�*�+���6�6�)�a��V�+�,��
���f�h�/�����b�!�W�,�-���6�6�*�q�!�f�,�-��
���f�h�/�����"�a��0�1���6�6�.�1�a�&�0�1��
���f�h�/�
��q�!��F�3��������!���6�6�,�'��
���f�h�/r1c��ttjjd�j	d�td�td���}|jd}|jd}||k(sJ�|jdd�dd�f}|jdd�d	gf}tj||�|jd
}|jd}||k(sJ�d}tjt|�
�5|jdddd�d}tjt|�
�5|jdddd�y#1swY�?xYw#1swYyxYw)Nrr��
abcdefghij�ABCDr}r�)�br�r;r�)rr)�jr�zCindex 5 is out of bounds for axis 0 with size 4|index out of boundsrq)rwrmz�Location based indexing can only have \[integer, integer slice \(START point is INCLUDED, END point is EXCLUDED\), listlike of integers, boolean array\] types)rrMr�r�r�r�r(r�rOrPr5r�r+�
ValueError)r,rSr�r�rUr�s      r/� test_iloc_getitem_labelled_framez8TestiLocBaseIndependent.test_iloc_getitem_labelled_frameYs9��
��I�I�!�!�!�$�4�4�W�=��|�$���L�
���������f�f�X�����}��}�����A�a�C�����6�6�!�c�U�(�#��
���f�h�/��������f�f�X�����}��}�T��
�]�]�:�S�
1�	��G�G�E�N�	�

;�	�
�]�]�:�S�
1�	��G�G�H��	�	�	�	��	�	�s�3E�(E
�E
�
Ec���tjjd�jd�}t	dd��}td�}t
|||��}|j�|jdd	�d
d�f}t
|dd	�d
d�f|dd	|d
d��}tj||�td�|_|jdd	�d
d�f}t
|dd	�d
d�f|dd	td���}tj||�tjjd�jd�}ttd
d
d��}ttd
dd��}t
|||��}|s#|jjd
j|jdd	�dd�f}t
|dd	�dd�f|dd	|dd��}tj||�y)Nr)r~rZ�20130101r~)�periodsr�r}r;rmr�aaaa�aar�r�rrZ)rMr�r�r�rr�r�describer(rOrPrprErGrH�mgr_locs)r,rQrarerprSr�rUs        r/�test_iloc_getitem_doc_issuez3TestiLocBaseIndependent.test_iloc_getitem_doc_issue|s����i�i�#�#�A�&�6�6�v�>���:�q�1���v�,��
�s�%��
9��	���
�����1��a��c��"���S��1��a��c��]�%��!�*�g�a�PQ�l�S��
���f�h�/��&�\��
�����1��a��c��"���S��1��a��c��]�%��!�*�d�4�j�Q��
���f�h�/��i�i�#�#�A�&�6�6�v�>���U�1�b�!�_�%���u�Q��1�~�&��
�s�%��
9��"��G�G�N�N�1��&�&�����1��a��c��"���S��1��a��c��]�%��!�*�g�a�PQ�l�S��
���f�h�/r1c��ttjjd�j	d�td�td���}d|jd<|jd}|dk(sJ�d|jdd�dd	�f<|jdd�dd	�f}|jdd�dd	�f}tj||�ttjjd�j	d
�tddd���}d|jd<|jd}|dk(sJ�d|jdd
|jdd
}|jdd
}tj||�tdgdz�}gd�|jddd�<gd�|jddd�<|}tgd��}tj||�y)Nrr�r�r�r}rr�rr;rwrlrdrZrr~)rrrZ)rr;rmrs)rrMr�r�r�r�r(rOrPrrEr�)r,rSr�rUr�s     r/�test_iloc_setitem_seriesz0TestiLocBaseIndependent.test_iloc_setitem_series�s���
��I�I�!�!�!�$�4�4�W�=��|�$���L�
�������
���������{��{������1�Q�3����7�7�1�a��c�6�?������A�a�C����
���f�h�/��2�9�9�(�(��+�;�;�B�?�u�Q�PR�TU��W������q�	���������{��{�����r��
��6�6�"�1�:���������
���v�x�0��B�4�!�8��� ����q�t�!�t�� ����q�t�!�t�����,�-��
���v�x�0r1c��ttjdd��tjddd��d��}ddgddgg|jd	d
tgd�gd�d��}t	j
||�tgd
�tjddd��d��}ddgddgg|jd	d
tgd�gd�d��}t	j
||�y)Nrm�int64r>rwr�ryr�r�rrZ)rrrwr�rZ)rmr~ryr�r��r�rr�r�r�r��y)r�rr�rr�)rrMr�r(rOrPr�s   r/�test_iloc_setitem_list_of_listsz7TestiLocBaseIndependent.test_iloc_setitem_list_of_lists�s�����)�)�A�W�-�B�I�I�a��7�4S�T�
���R��2�r�(�+�����!���#4�;L�M�N��
���b�(�+�
�+�"�)�)�A�r��2Q�R�
���b�	�C��9�-�����!���#<�CT�U�V��
���b�(�+r1r�value�Zc��tddgddggddg��jdti�}||jd|f<|jd	}t	|�r|d
k(sJ�y)Nrrr;rZrvr�rorrCr)rrLrFr(r)r,r<rrSr�s     r/�#test_iloc_setitem_with_scalar_indexz;TestiLocBaseIndependent.test_iloc_setitem_with_scalar_index�se����A���A��'�#�s��
<�
C�
C�S�&�M�
R��#�����7�
���������� �V�s�]�2�2�]r1zignore::UserWarningc��tttd��td�dg��}|jdzdk(}d}t	j
t|��5|j|ddd�tt|��|_	d	}t	j
t|��5|j|ddd�|jtjd
gt|�zt��}tj||�tj d�}d|z}|D�cgc]
}t#|���}}t||d
�|�}ddddddddd	d�	}	dD]�}
|j$dkDj&}|
r't)||
�ddd�}t+|t|��}dD]n}	|rt)||dd�}
n|}
t-t#|
|dj/���}|
|f}|	j3|�}||k7s�[t5d|�d|�d|�d�����y#1swY���xYw#1swY��lxYwcc}w#tt0tf$r}t-|�}Yd}~�wd}~wwxYw)Nrmrnr�r}rrzBiLocation based boolean indexing cannot use an indexable as a maskrqzDiLocation based boolean indexing on an integer type is not availableTr>rZ)�locs�nums�0b1100�0b11ztUnalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match).)	)N�)N�.loc)N�.iloc)rer)rer)rer)rr)rr)rr)Nrerr)rrrrr�[z] does not match [z
], received [�])rr�rEr�r5r�rr(r�re�NotImplementedErrorrMr�boolrOrPr��binrrK�getattrr�str�sumr�get�AssertionError)r,rSr�r�r�rr�num�repsrU�idx�
mask_index�method�accessor�answer�errr�rs                  r/�test_iloc_maskz&TestiLocBaseIndependent.test_iloc_mask�sY���t�E�!�H�~�T�'�]�S�E�
J���t�t�a�x�1�}��R��
�]�]�:�S�
1�	��G�G�D�M�	��3�t�9�%��
�T��
�]�]�.�c�
:�	��G�G�D�M�	�������4�&�3�t�9�"4�D�A�B��
���f�b�)��y�y��|���$�w��$(�)�S��C��)��)�
��d�3�T�
:��!�$�%�!�%�T�$�,�0�!
��,+�	�C��G�G�a�K�'�'�D��$�R��-�d��d�3�
��d�D��$4�5��/�
��&��#*�2�v�a�b�z�#:��#%�� ��X�d�^�F�%;�%?�%?�%A�!B�C�F�
�����L�L��%����;�(��C�5� 2�6�(�-��s�!�L���!
�	�O	�	��	�	��*��J#�M�3F�G�&� ��X�F��&�s6�H�(H"�)H/�%<H4�H�"H,�4I�I�Ic���tdgdzdgdzd��}tjd�dz}|j|}t	|d|zd|zg�}|j|}tj||�tdgd	zdgd	zd��}t	|d|zd|zg�}tjtd
��5|j|ddd�y#1swYyxYw)N皙�����?r�rr�rt�crr;r�znot in indexrq)rrMr�r(rrOrPr5r��KeyErrorr�)r,rSr+rU�df3r�r�s       r/�test_iloc_non_unique_indexingz5TestiLocBaseIndependent.test_iloc_non_unique_indexing's���
�c�U�T�\���d�
�;�
<���i�i��m�b� ���7�7�3�<���b�!�b�&�!�b�&�)�*�����#���
���f�h�/��s�e�d�l�!��t��<�=���c�1�s�7�A��G�,�-��
�]�]�8�>�
:�	��G�G�C�L�	�	�	�s�<C�Cc�T�ttjd�tt	d�D�cgc]}d|����	c}d��tt	d�D�cgc]}d|����	c}d����}tj|jdd�gf|jdd�dd�fd	d	�
�tj|jgdd�f|jdd�dd�fd	d	�
�tj|jg|jdd�dd�fd	d	�
�ycc}wcc}w)Nr{rmzi-r��r�rr}rT)�check_index_type�check_column_type)rrM�onesr	rErOrPr()r,�irSs   r/�"test_iloc_empty_list_indexer_is_okz:TestiLocBaseIndependent.test_iloc_empty_list_indexer_is_ok8s���
��G�G�F�O��5��8�4�a�2�a�S��4�3�?��U�1�X�6��R��s�8�6�S�A�
��	����G�G�A�r�E�N��G�G�A�r��r�E�N�!�"�		
�	����G�G�B��E�N��G�G�B�Q�B��E�N�!�"�		
�	����G�G�B�K�����!��Q���$�RV�	
��%5��6s�D �D%c�n�tdgd�i�}|jdd}||usJ�tj|d|d�sJ�t	j
|�5gd�|jdd�df<ddd�|r|dgd�k(j�sJ�|ddk(j�sJ�tgd��}|jdd}||usJ�t	j
|�5gd�|ddddd�|rt|ddgd�k(�sJ�yt|ddgd�k(�sJ�y#1swY��xYw#1swY�CxYw)Nr�r�)rZrZrZrZ)rrr;rZrmr~�r�r�r�r;)	rr(rMrNrO�assert_cow_warningr��allr)r,r`r��original_df�	sliced_df�original_series�
sliced_seriess       r/�&test_identity_slice_returns_new_objectz>TestiLocBaseIndependent.test_identity_slice_returns_new_objectQsU�� ��i� 0�1���$�$�Q�'�	���+�+�+�����C� 0�)�C�.�A�A�A��
"�
"�#5�
6�	0�&/�K�O�O�A�s�F�#�	0���c�N�i�/�4�4�6�6�6��c�N�a�'�,�,�.�.�.� �!3�4��'�,�,�Q�/�
��O�3�3�3��
"�
"�#5�
6�	,�"+�O�B�Q��	,���}�R�a�(�I�5�6�6�6��}�R�a�(�I�5�6�6�6�%	0�	0��	,�	,�s�D�!D+�D(�+D4c��tddgddgg�}|jtjd�}t	ddgd��}tj||�y)Nrrr;rZrr:)rr(rMrrrOr�)r,rSr�r�s    r/�test_indexing_zerodim_np_arrayz6TestiLocBaseIndependent.test_indexing_zerodim_np_arrayrsO��
��A���A��'�
(��������!��%���A�q�6��"��
���v�q�)r1c�p�tddg�}|jtjd�}|dk(sJ�y)Nrrr)rr(rMr)r,r�r�s   r/�%test_series_indexing_zerodim_np_arrayz=TestiLocBaseIndependent.test_series_indexing_zerodim_np_arrayys1���A�q�6�N����������$����{��{r1c�.�tgd��}t|gd�d�d��}tj|d|�sJ�|ddd�|jdd�df<tj|d|�sJ�tgd	�gd��
�}tj
||�y)Nr�r�)rrF)rJrrr)r�r�rv��
categories)rrrOrNr(�assert_categorical_equal)r,rRrSrUs    r/�-test_iloc_setitem_categorical_updates_inplacezETestiLocBaseIndependent.test_iloc_setitem_categorical_updates_inplaces����/�*��
�3�9�-�E�
:������1��s�+�+�+��D�b�D�	�����1��
�����1��s�+�+�+���?�K��
�#�#�C��2r1c��tddgddgddgdtjgg�}|j|jdkxxdzcc<tddgddgdd	gdtjgg�}tj||�|j|jdkDxxdzcc<tddgddgdd	gd
tjgg�}tj||�|jgd�xxdzcc<tddgdd
gdd	gd
tjgg�}tj||�|jgd�xxdzcc<tdd
gddgddgdtjgg�}tj||�y)Nrrrr;rZrmr~r�rwr�)TTFF)FFTTg@g(@g@)rrMr�r(rerOrP�r,r�rUs   r/� test_iloc_with_boolean_operationz8TestiLocBaseIndependent.test_iloc_with_boolean_operation�si���Q��F�Q��F�Q��F�Q����K�@�A�����F�L�L�A�%�&�!�+�&��q�!�f�q�!�f�q�"�g��2�6�6�{�C�D��
���f�h�/����F�L�L�1�$�%��*�%��q�!�f�q�!�f�q�"�g��B�F�F�|�D�E��
���f�h�/����.�/�1�4�/��q�!�f�q�"�g��2�w��R�V�V��E�F��
���f�h�/����.�/�1�4�/��q�#�h��D�	�A�s�8�a����[�I�J��
���f�h�/r1c���tdtdj��i�}|jd}tdggd���}t	|dgdd��}tj||�y)	Nr�z	a b c d err�rrN�category)rer�r?)rr�splitr(rrOr�)r,rSr��raw_catrUs     r/�?test_iloc_getitem_singlerow_slice_categoricaldtype_gives_serieszWTestiLocBaseIndependent.test_iloc_getitem_singlerow_slice_categoricaldtype_gives_series�s]��
��[��):�):�)<�=�>�
?���������s�e�0I�J���'�#��Q�j�I��
���v�x�0r1c�
�tgd��jd�}|jdd}tddg�jtgd���}t	j
||�|jddg}tddg�jtgd���}t	j
||�|jgd�}tdg�jtgd���}t	j
||�y)Nr�rVrrr�TFF)rrLr(rrOr�)r,rir�rUs    r/�$test_iloc_getitem_categorical_valuesz<TestiLocBaseIndependent.test_iloc_getitem_categorical_values�s����Y��&�&�z�2�����!�A����1�a�&�>�(�(�)9�)�)D�E��
���v�x�0����1�a�&�!���1�a�&�>�(�(�)9�)�)D�E��
���v�x�0����.�/���1�#�;�%�%�&6�y�&A�B��
���v�x�0r1c��tgd�d��}||jd<ttddgd��}tj||�y)Nrztimedelta64[ns]r>rrr)rr(rrOr�)r,rrrUs    r/�%test_iloc_setitem_td64_values_cast_naz=TestiLocBaseIndependent.test_iloc_setitem_td64_values_cast_na�sA���	�):�;������A���3��1�+�->�?��
���v�x�0r1�not_nar�g�?c��t|g��}t||||g|��}|||g|jddt||||g|��}tj||�y)NrNr>r;)rrr(rOr�)r,r_�
nulls_fixturer?rir�s      r/�$test_setitem_mix_of_nan_and_intervalz<TestiLocBaseIndependent.test_setitem_mix_of_nan_and_interval�sg��!�V�H�5���
�M�=�-�H�PU�
��&�v�}�=�����!���m�V�]�M�J�RW�X��
���s�C�(r1c��tg�}ttjj	d�jt
|�t
|�f�||��}tjj	d�jdd��}d|j��}tjt|��5d|j|<ddd�y#1swYyxYw)	Nrr}rm)rrrr�zCannot set values with ndim > rqr)
r	rrMr�r�r�r�r��ndimr5r�rr()r,r+r.�nd3r�s     r/�4test_iloc_setitem_empty_frame_raises_with_3d_ndarrayzLTestiLocBaseIndependent.test_iloc_setitem_empty_frame_raises_with_3d_ndarray�s����B�i����I�I�!�!�!�$�4�4�c�#�h��C��5I�J���
��
�i�i�#�#�A�&�/�/��	�/�B��.�s�x�x�j�9��
�]�]�:�S�
1�	��C�H�H�S�M�	�	�	�s�4C
�
Cc���tjd�}t|�}tjd�}|jd��t|�}t	j
||�gd�||�gd��t	j
||�dg||�dg�t	j||�d||�d�t	j
||�dd||�dd�y)NrwF)�writer�rr;)rM�eyer�setflagsrOrPr�)r,r<�rw_array�rw_df�ro_array�ro_dfs      r/�"test_iloc_getitem_read_only_valuesz:TestiLocBaseIndependent.test_iloc_getitem_read_only_values�s����6�6�"�:���(�#���6�6�"�:�������&��(�#��
���g�e�n�Y�7����	�9R�S�
���g�e�n�a�S�1�7�5�>�1�#�3F�G�
���w�u�~�a�0�'�%�.��2C�D�
���g�e�n�Q�q�1�7�5�>�!�A�3F�Gr1c�|�tdtjdd��i�}tjgd��}d|j_|j|}|jgd�}tj||�|dj|}|djgd�}tj||�y)N�dataru�float64r>)rr;r~F)rrMr=r�flags�	writeabler(r�rOrPr�)r,rS�indicesr�rUs     r/�test_iloc_getitem_readonly_keyz6TestiLocBaseIndependent.test_iloc_getitem_readonly_key�s���
������9� =�>�
?���(�(�9�%��"'��
�
������!���6�6�)�$��
���f�h�/��F�����)���f�:�>�>�)�,��
���v�x�0r1c��tdgdg��}tgd��|jd<tdtgd��gidgdg��}tj||�y)Nr�r�rprer�rC)rrr(rOrPr�s   r/�"test_iloc_assign_series_to_df_cellz:TestiLocBaseIndependent.test_iloc_assign_series_to_df_cell�sS��
��u�Q�C�
0���y�)�����
��c�F�9�$5�#6�7�#��q�c�R��
���b�(�+r1�klassc���tgd�gd�d��}|gd��}|j|dfdz|j|df<tgd�gd�d��}tj||�y)N)r�r�z)rr;rZ)�flagrr[rr)rr;rZr�)r,rzrSr<rUs     r/�test_iloc_setitem_bool_indexerz6TestiLocBaseIndependent.test_iloc_setitem_bool_indexersa����)�D�
E���,�-�� �g�g�g�q�j�1�A�5������
���o�	�J�K��
���b�(�+r1rc���tgd�gd�d��}tgd�gd�gd�d��}|jdd�dgf|jdd�|f<tgd�gd�gd�d��}tj||�y)	N)ryr�r�)r���)�a2�b2r�rrA�r�rr�rr�)r,r<r�r�rUs     r/�%test_iloc_setitem_pure_position_basedz=TestiLocBaseIndependent.test_iloc_setitem_pure_position_based
sf���|�<�@�A���i�i�i�H�I��"�x�x��A�3��/�����G����9�<�i�P�Q��
���c�8�,r1c�2�tddgddgd��}ddd�}||jd<tddgddgd��}tj||�tddgddgd��}||jd<tddgddgd��}tj||�y)Nrr)r�rr�r5g@g�X@r�)r,rS�rhsrUs    r/�"test_iloc_setitem_dictionary_valuez:TestiLocBaseIndependent.test_iloc_setitem_dictionary_values���
�a��V�1�a�&�1�
2���B��������
��A�q�6��B��8�9��
���b�(�+��a��V�3��*�5�
6�������
��A�q�6��d��<�=��
���b�(�+r1c��ttjjd�j	d�gd�td���}|jdd}tj|jd|�|jdd�df}tj|jd	|�gd
�|_|jdd}tj|jd|�|jdd�df}tj|jd	|�ttjjd�j	d�gd�td���}|jdd
}tj|jd|�|jdd
�df}tj|jd	|�gd�|_|jdd
g}tj|jd|�|jdd
gdf}tj|jd	|�y)Nrr�)r4皙�����?r��abcr}rr�r)r�r�)rr�r�)rZr;)rr�r�rr)r4r�rr�)rrMr�r�r�r�r(rOrPr�r�re)r,rS�expects   r/�"test_iloc_getitem_float_duplicatesz:TestiLocBaseIndependent.test_iloc_getitem_float_duplicates$s���
��I�I�!�!�!�$�4�4�V�<�!���K�
��
�������
���b�f�f�S�k�6�2������Q����
���r�v�v�h�/��8� ����������
���b�f�f�S�k�6�2������Q����
���r�v�v�h�/��8�
��I�I�!�!�!�$�4�4�V�<�"���K�
��
����2���
���b�f�f�S�k�6�2�����2��q��!��
���r�v�v�h�/��8�%������!�R��!��
���b�f�f�S�k�6�2����!�R��!��$��
���r�v�v�h�/��8r1c���Gd�d�}tddgdg��}|d�|jd<|d�|jd<tddgdg��}|d�|jd<tj||�tddgdg��}|d�|jd<tj
|jd<tddgdg��}tj||�y)Nc�6�eZdZdd�Zdefd�ZeZdefd�Zd�Z	y)�CTestiLocBaseIndependent.test_iloc_setitem_custom_object.<locals>.TO�returnNc��||_y�N�r)r,rs  r/�__init__zLTestiLocBaseIndependent.test_iloc_setitem_custom_object.<locals>.TO.__init__Ls	��"��
r1c�"�d|j�d�S)Nrr r��r,s r/�__str__zKTestiLocBaseIndependent.test_iloc_setitem_custom_object.<locals>.TO.__str__Os���4�:�:�,�a�(�(r1c�4�|j|jk(Sr�r�)r,�others  r/�__eq__zJTestiLocBaseIndependent.test_iloc_setitem_custom_object.<locals>.TO.__eq__Ts���z�z�U�[�[�0�0r1c��|Sr�r8r�s r/�viewzHTestiLocBaseIndependent.test_iloc_setitem_custom_object.<locals>.TO.viewWs���r1)r�N)
r2r3r4r�r%r��__repr__r"r�r�r8r1r/�TOr�Ks+��
#�
)��
)��H�
1�t�
1�
r1r�rrr}rfr)rr(rOrPrMr�)r,r�rSr�s    r/�test_iloc_setitem_custom_objectz7TestiLocBaseIndependent.test_iloc_setitem_custom_objectIs���
	�
	��a��V�a�S�
1���1������
��1������
��!�Q��!��5���q�E����D��
���f�b�)��a��V�a�S�
1���1������
��������
��!�Q��!��5��
���f�b�)r1c���ttjjd�jd�t	d�t	d���}|j
d}t
|t�sJ�tj|j|jd�|jj
dd�df}t
|t�sJ�tj|j|jd�y)Nrr��ABC�aabrxr)rrMr�r�r�r(�
isinstancerrO�assert_almost_equalrK�T)r,rSr�s   r/�!test_iloc_getitem_with_duplicatesz9TestiLocBaseIndependent.test_iloc_getitem_with_duplicatesks���
��I�I�!�!�!�$�+�+�F�3���K��u�+�
���������&�&�)�)�)�
���v�}�}�b�i�i��l�;������1�a�4����&�&�)�)�)�
���v�}�}�b�i�i��l�;r1c��tgd�gd�ggd���}|jdd�dgf}|jdgd��}tj||�y)Nr�r)rrrrorrr�)rr(�takerOrP�r,rSr�rUs    r/�"test_iloc_getitem_with_duplicates2z:TestiLocBaseIndependent.test_iloc_getitem_with_duplicates2zsJ��
�	�9�-�y�
A������Q�C�����7�7�A�3�Q�7�'��
���f�h�/r1c���ttdd�ddgi�}|jd}ttdd�did��}t	j
||�|jdd�df}tddgtdd���}t	j
||�|j
�}|jdd�dfxxdz
cc<ttdd�ddgi�}t	j||�y)Nrrrr:r;)rr
r(rrOr�rJrPr�s    r/�test_iloc_intervalz*TestiLocBaseIndependent.test_iloc_interval�s���
���A���A��/�
0���������8�A�q�>�1�-�A�6��
���v�x�0�����A�����1�a�&�x��1�~�6��
���v�x�0���������A�q�D��Q����h�q�!�n�q�!�f�5�6��
���f�h�/r1�
indexing_func�rhs_funcc�L�tgd��}|ddg�|j|gd��<tgd��}tj||�t	dgd�i�}|dgdgg�|j|gd��<t	dgd�i�}tj
||�y)Nrrmrw�TFT)rmrrwr�)rr(rOr�rrP)r,r�r�rirUrSs      r/�test_loc_setitem_boolean_listz5TestiLocBaseIndependent.test_loc_setitem_boolean_list�s����Y���7?��B��7H�����2�3�4��*�%��
���s�H�-�
��Y�'�
(��6>���b�T�{�6K����
�1�2�3��c�:�.�/��
���b�(�+r1c��tdgd�id��}|jdd�ddd�f}tj||�d|d<|jdd�ddd�f}t|d|dd��}tj||�y)	Nrvr��Int64r>r�foor�)r�rvr�)r,rS�resrUs    r/�.test_iloc_getitem_slice_negative_step_ea_blockzFTestiLocBaseIndependent.test_iloc_getitem_slice_negative_step_ea_block�s��
��Y�'�w�
7���g�g�a��2��g���
���c�2�&���3���g�g�a��2��g����2�c�7��C��9�:��
���c�8�,r1c�0�tdgd�id��}tjdgdgg�|jtjddg�tjdg�f<tdgd�i|dj��}tj||�y)	N�statusr�rVr>r�rr)r�r�r�)rrMrr(r?rOrPr�s   r/�*test_iloc_setitem_2d_ndarray_into_ea_blockzBTestiLocBaseIndependent.test_iloc_setitem_2d_ndarray_into_ea_block�sy��
��/�2�*�
E��35�8�8�c�U�S�E�N�3K�������!�Q�� �"�(�(�A�3�-�/�0��h��8��8��@R�@R�S��
���b�(�+r1c��tdd�j}t|�}|jd}|d|dk7sJ�|d|d<|d|dk(sJ�y)Nrg$@rrr)r�_valuesrr()r,rarSris    r/�*test_iloc_getitem_int_single_ea_block_viewzBTestiLocBaseIndependent.test_iloc_getitem_int_single_ea_block_view�si���Q��%�-�-��
�s�^���g�g�a�j���1�v��R�� � � ��R���A���1�v��R�� � � r1c���tddgddgd��}tdtddg�i�|jdd�dgf<ttd�td	�gddgd��}t	j
||d
��y)Nz
2022-01-01z
2022-01-02�2021�2022r�rvrz2021-01-01 00:00:00z2022-01-01 00:00:00F)�check_dtype)rrr(r
rOrPr�s   r/�)test_iloc_setitem_multicolumn_to_datetimezATestiLocBaseIndependent.test_iloc_setitem_multicolumn_to_datetime�s���
�l�L�9���@P�Q�
R��#�S�+�v�v�6F�*G�$H�I�����A�3�����3�4��3�4���f�%�
�
��	���b�(��>r1)Qr2r3r4�__doc__r5r6r7�slicerEr	rM�asarrayrOr�r(rVrrrbrjr�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr
rr�filterwarningsr2r8r?rHrJrLrQrTrYr\rr�r^r
rbrfrorvryr~r�r�r�r�r�r�r�r�r�r��td�&skip_array_manager_not_yet_implementedr�r�r8r1r/r:r:<sJ��)��[�[���
��$�K��!�H��!�H���%��(�O��B�J�J�y�!�
	
�
��[�[���Y�������(9�:�,�;�
�,�@�[�[���U�U�F�O�4�;�5�;�:1�c�J�[�[���_�	��	�	�"�
�t�G�}�/M�.N�O��[�[��� ��D�k�C��:�
&��3�Z��t��%��t�Q��"�
#�U�4�[�1�	
��	-��P�	-��H�1�61�0�&0�&�[�[���W��e�}�6P�&Q�R��S��0�.5�:,�,,� 
,�,�,�8,�:/0�b!�F"0�H 1�D,�"�[�[���Y�!��e�D�!�T�.B�H�B�H�H�a�S�M�(R�S��[�[���W��u�h�b�h�h��u�o�&>�?�
3�@�T�
3��[�[��� 5�6�C�7�C�J�"
�27�B*��
3�0�&1�1�*�[�[���W�t�S�"�&�&�&9�:�1�;�1��[�[���X���A���S�'A�B�)�C�)���[�[���Y�������(9�:�
H�;�
H�1�,��[�[���W�t�R�X�X�&6�7�,�8�,��[�[���Y�!��e�A�q�k�(:�;�-�<�-�,�#9�J *�D
<�0�0�"�[�[���_�t�R�X�X�.>�?��[�[���Z�$����)9�:�
,�;�@�
,�
-�,��.�.�!�/�!�?r1r:c��eZdZd�Zd�Zd�Zy)�TestILocErrorsc��|}|tur|j�}d}tjt|��5|j
dddd�tjtt��5tj|xr|tu�5d|j
d<ddd�ddd�y#1swY�ixYw#1swY�xYw#1swYyxYw)Nz5Cannot index by location index with a non-integer keyrqg@r)
rrhr5r�r�r(r+�_slice_iloc_msgrOrB)r,�series_with_simple_indexr_r�r.r�s      r/�test_iloc_float_raisesz%TestILocErrors.test_iloc_float_raises�s���'���i�'��,�,�.�C�E��
�]�]�9�C�
0�	��H�H�S�M�	��]�]�:�_�
=�	"��&�&�"�C��)�'C��
"�!"�����
�
"�	"�	"�	�	��
"�
"��	"�	"�s/�B0�/ C�B<�C�0B9�<C	�C�Cc�$�tjtd��5|jdd�dd�dd�fddd�tjtd��5d|jdd�dd�dd�f<ddd�y#1swY�FxYw#1swYyxYw)NzToo many indexersrqztoo many indices for arrayr)r5r�rr(r+)r,�float_frames  r/�*test_iloc_getitem_setitem_fancy_exceptionsz9TestILocErrors.test_iloc_getitem_setitem_fancy_exceptions�s{��
�]�]�=�0C�
D�	&����Q��1�W�%�	&��]�]�:�-I�
J�	*�()�K���Q��1�W�%�	*�	*�	&�	&��	*�	*�s�A:�B�:B�Bc�D�tdgd�i�}tdgd�i�}d}tjt|��5d|j|<ddd�d}tjt
|��5|j|ddd�y#1swY�?xYw#1swYyxYw)Nr�r�r�zADataFrame indexer for .iloc is not supported. Consider using .locrqrzWDataFrame indexer is not allowed for .iloc
Consider using .loc for automatic alignment.)rr5r�r�r(r+)r,rSr<r�s    r/�test_iloc_frame_indexerz&TestILocErrors.test_iloc_frame_indexer�s���
��Y�'�
(���S�"5�6�7��Q��
�]�]�9�C�
0�	!� �B�G�G�G��	!�
;�	��]�]�:�S�
1�	��G�G�G��	�	�	!�	!��	�	�s�B
�1B�
B�BN)r2r3r4r�r�r�r8r1r/r�r��s��"�0*�
r1r�c�j�eZdZd�Zd�Zd�Zejjgd�ddg�d��Z	y)	�TestILocSetItemDuplicateColumnsc�4�tddd�ddd�g�}tddd�ddd�g�}t||gd��}d|jd<|jddk(sJ�|jd	dk(sJ�|jjdtj
k(sJ�y)
Nrr�rr;rZr�rrC)rr)rrr(�dtypesrMr)r,r�r�rSs    r/�*test_iloc_setitem_scalar_duplicate_columnszJTestILocSetItemDuplicateColumns.test_iloc_setitem_scalar_duplicate_columnss����t�!�,�A�A�.>�?�@���q�q�)���+;�<�=��
�S�#�J�Q�
'�������
��w�w�t�}��"�"�"��w�w�t�}��!�!�!��y�y�~�~�a� �B�H�H�,�,�,r1c��tgd�ggd���}dg|jdd�df<tgd�ggd���}tj||�y)N)rr%�str2�r�rrro�str3r)rr%r�r�r�s   r/�(test_iloc_setitem_list_duplicate_columnszHTestILocSetItemDuplicateColumns.test_iloc_setitem_list_duplicate_columnssE��
�*�+�_�
E��������1��
��0�1�?�K��
���b�(�+r1c�b�ttjdtj��j	dd�gd���}|j
dd�dfj
tj�|j
dd�df<|jj
dtjk(sJ�y)Nr�r>rrZr�ror)	rrMr�rr�r(rLrrr�)r,rSs  r/�*test_iloc_setitem_series_duplicate_columnszJTestILocSetItemDuplicateColumns.test_iloc_setitem_series_duplicate_columnss{��
��I�I�a�r�x�x�(�0�0��A�6�@T�
������1��
�,�,�R�Z�Z�8�����1��
��y�y�~�~�a� �B�H�H�,�,�,r1)r��
init_value�expected_value)r�0r)�floatz1.2g333333�?c��t|ddgggd�t��}|jdd�dfj|�|jdd�df<t|ddgggd�t��}t	j
||�y)Nr%r�r�)rpr?r)rrFr(rLrOrP)r,r�r�r�rS�expected_dfs      r/�*test_iloc_setitem_dtypes_duplicate_columnszJTestILocSetItemDuplicateColumns.test_iloc_setitem_dtypes_duplicate_columns#sx����%��
(�)�?�&�
������1��
�,�,�V�4�����1��
���e�V�
,�-�#��
��
	���b�+�.r1N)
r2r3r4r�r�r�r5r6r7r�r8r1r/r�r�s@��	-�,�-��[�[���2�	�1�2��/�	�/r1r�c��eZdZd�Zd�Zy)�TestILocCallablec���tgd�td�d�td���}|jd�}tj||jddg�|jd	�dd�f}tj||jddgdd�f�|jd
�d�f}tj
||jddgdf�|jd
�d�f}tj||jddgdgf�|jddgd�f}tj
||jddgdf�|jddgd�f}tj||jddgdgf�|jd�df}tj
||jddgdf�|jd�dgf}tj||jddgdgf�y)NrY�aabb��X�Yr�rdc�
�ddgS�Nrr;r8r�s r/r�zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>A�
���A��r1rr;c�
�ddgSr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>Dr�r1c�
�ddgSr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>Gr�r1c��y�Nrr8r�s r/r�zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>G��r1rc�
�ddgSr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>Jr�r1c��dgSr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>Js��1�#�r1c��yr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>Nr�r1c��dgSr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>Qs����r1c�
�ddgSr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>Tr�r1c�
�ddgSr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_getitem_callable.<locals>.<lambda>Wr�r1)rr�r(rOrPr�)r,rSr�s   r/� test_frame_iloc_getitem_callablez1TestILocCallable.test_frame_iloc_getitem_callable<s���
�\��V��=�T�&�\�
R���g�g�&�'��
���c�2�7�7�A�q�6�?�3��g�g�&��)�*��
���c�2�7�7�A�q�6�1�9�#5�6��g�g�&��3�4��
���s�B�G�G�Q��F�A�I�$6�7��g�g�&�
�5�6��
���c�2�7�7�A�q�6�A�3�;�#7�8��g�g�q�!�f�k�)�*��
���s�B�G�G�Q��F�A�I�$6�7��g�g�q�!�f�m�+�,��
���c�2�7�7�A�q�6�A�3�;�#7�8��g�g�&��)�*��
���s�B�G�G�Q��F�A�I�$6�7��g�g�&���+�,��
���c�2�7�7�A�q�6�A�3�;�#7�8r1c�6�tgd�ttd�t��d�td���}|j	�}d|j
d�<|j	�}d|j
d	d
g<t
j||�|j	�}d|j
d�dd�f<|j	�}d|j
d	d
gdd�f<t
j||�|j	�}d
|j
d�d�f<|j	�}d
|j
d	d
gdf<t
j||�|j	�}d|j
d�d�f<|j	�}d|j
d	d
gdgf<t
j||�|j	�}d|j
d	d
gd�f<|j	�}d|j
d	d
gdf<t
j||�|j	�}d|j
d	d
gd�f<|j	�}d|j
d	d
gdgf<t
j||�|j	�}d|j
d�df<|j	�}d|j
d	d
gdf<t
j||�|j	�}ddg|j
d�dgf<|j	�}ddg|j
d	d
gdgf<t
j||�y)NrYr�r>r�r�rdrc�
�ddgSr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>c�
��A�q�6�r1rr;rc�
�ddgSr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>ir�r1rmc�
�ddgSr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>or�r1c��yr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>or�r1�c�
�ddgSr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>ur�r1c��dgSr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>us��a�S�r1r�c��yr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>|r�r1���c��dgSr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>�s��A�3�r1rwc�
�ddgSr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>�r�r1c�
�ddgSr�r8r�s r/r�zCTestILocCallable.test_frame_iloc_setitem_callable.<locals>.<lambda>�r�r1)rrr�rFrJr(rOrP)r,rSr�r�s    r/� test_frame_iloc_setitem_callablez1TestILocCallable.test_frame_iloc_setitem_callableZs���
��V�D��L��%G�H��v�,�
���g�g�i��%&����!�"��g�g�i������!�Q���
���c�3�'��g�g�i��(*����!�1�$�%��g�g�i�� ����!�Q�����
���c�3�'��g�g�i��23����!�;�.�/��g�g�i������!�Q�����
���c�3�'��g�g�i��46����!�=�0�1��g�g�i�� "����!�Q��!����
���c�3�'��g�g�i��(*����!�Q���$�%��g�g�i�� ����!�Q�����
���c�3�'��g�g�i��*,����!�Q���&�'��g�g�i�� "����!�Q��!����
���c�3�'��g�g�i��(*����!�1�$�%��g�g�i�� ����!�Q�����
���c�3�'��g�g�i��+-�r�(����!�A�3�&�'��g�g�i��!#�R�����!�Q��!����
���c�3�'r1N)r2r3r4r�rr8r1r/r�r�;s��9�<7(r1r�c�$�eZdZd�Zd�Zd�Zd�Zy)�TestILocSeriesc
��ttjjd�j	d�tt
ddd����}|j�}t
t|��D]9}|j|}||j|}tj||��;|jtdd�}|jdd}tj||�tj d�5tj"|�5d|ddddd�ddd�|rtj||�n"|jdddk(j%�sJ�|jgd	�}|j'|jgd	��}tj||�y#1swY��xYw#1swY��xYw)
Nrrwrrlrdrr;rZ)rrr;rZrm)rrMr�r�r�r�rErJr�r(rerOr�r�r�r�r�rBrC�reindex)	r,r`r�ri�ser_originalr>r�r�rUs	         r/�	test_iloczTestILocSeries.test_iloc�s�����I�I�!�!�!�$�4�4�R�8��U�1�b�RS�_�@U�
���x�x�z���s�3�x��	0�A��X�X�a�[�F��c�i�i��l�#�C��"�"�6�3�/�	0����%��1�+�&���7�7�1�Q�<��
���v�x�0��
'�
'��
-�	��&�&�'9�:�
���q�	�
�	���"�"�3��5��H�H�Q�q�M�Q�&�+�+�-�-�-����/�*���;�;�s�y�y��9�:��
���v�x�0�
�
��	�	�s$�F<�F0�F<�0F9	�5F<�<Gc�N�tgd�gd���}|jddk(sJ�y)Nrr�rdr)rr()r,ris  r/�test_iloc_getitem_nonuniquez*TestILocSeries.test_iloc_getitem_nonunique�s$���Y�i�0���x�x��{�a���r1c��tgd��}tgd�gd���}|jdd|jddtgd��}tj||�y)Nr�r)rrrrdrr;)rrmr~)rr(rOr�)r,�ser1�ser2rUs    r/r�z4TestILocSeries.test_iloc_setitem_pure_position_based�sK���i� ���i�y�1�����1�Q���	�	�!�A���)�$��
���t�X�.r1c�p�tdgtjgd��}tjt
d��5|jdd�dfjd�|jdd�df<ddd�tdgttgd��d��}tj||�y#1swY�?xYw)N�test)r�rr�rqrr�r>)rrMr�rOr�r�r�rLrrrPrSs   r/�#test_iloc_nullable_int64_size_1_nanz2TestILocSeries.test_iloc_nullable_int64_size_1_nan�s����&������9�:��
�
'�
'�
�=Q�
R�	D�!'���A�s�F�!3�!:�!:�7�!C�F�J�J�q�#�v��	D��F�8�%���G�2L�M�N��
���f�h�/�	D�	D�s�4B,�,B5N)r2r3r4rrr�rr8r1r/r
r
�s��1�> �/�0r1r
)+r�r�re�numpyrMr5�
pandas.errorsr�pandas.util._test_decorators�util�_test_decoratorsr��pandasrrrrr	r
rrr
rrrrrr�pandas._testing�_testingrO�pandas.api.typesr�pandas.tests.indexing.commonr�escaper�rr:r�r�r�r
r8r1r/�<module>r&s���0��	��
�'�)�)������"�&�K��"�)�)�6���
�
�(U?�U?�p$0�0�f1/�1/�hV(�V(�r20�20r1

Youez - 2016 - github.com/yon3zu
LinuXploit