
    A>i*                     T    S r SSKrSSKrSSKJrJrJrJrJ	r	  SSK
Jr   " S S5      rg)z
test_insert is specifically for the DataFrame.insert method; not to be
confused with tests with "insert" in their names that are really testing
__setitem__.
    N)	DataFrameIndex
MultiIndexNaT	Timestampc                   >    \ rS rSrS rS rS rS rS rS r	S r
S	rg
)TestDataFrameInsert   c                    [        [        R                  R                  S5      R	                  S5      [        R
                  " S5      / SQS9nUR                  SSUS   5        [        R                  " UR                  [        / S	Q5      5        [        R                  " US   US   S
S9  UR                  SSUS   5        [        R                  " UR                  [        / SQ5      5        [        R                  " US   US   S
S9  [        R                  " [        SS9   UR                  SSUS   5        S S S 5        Sn[        R                  " [        US9   UR                  SSUS   5        S S S 5        SUR                  l        UR                  SSUS   5        UR                  R                   S:X  d   eg ! , (       d  f       N= f! , (       d  f       Nc= f)N   )      r   )cba)indexcolumnsr   foor   )r   r   r   r   F)check_namesbarr   )r   r   r   r   r   zalready existsmatch   r   zcannot insert c, already exists	some_namebaz)r   nprandomdefault_rngstandard_normalarangeinserttmassert_index_equalr   r   assert_series_equalassert_almost_equalpytestraises
ValueErrornameselfdfmsgs      f/var/www/html/land-tabula/venv/lib/python3.13/site-packages/pandas/tests/frame/indexing/test_insert.pytest_insertTestDataFrameInsert.test_insert   sh   II!!!$44V<))A,#
 			!UBsG$
bjj%0F*GH
r#w5	uE
		!UBsG$
bjj%0M*NO
r#w5	uE]]:-=>IIabg& ? 0]]:S1IIabg& 2 &


		!UBsG$zz+--- ?> 21s   #G G 
G
Gc                 p   [        SSS/05      nUR                  0 S9nUR                  SSSS/5        UR                  0 S9n[        SS/SS//SS/S9n[        R                  " X#5        UR                  SS	S
S/5        UR                  0 S9n[        / SQ/ SQ// SQS9n[        R                  " X#5        g )Nr   皙?皙@r   r   r   r   r   r   ?ffffff@)r5   r   r2   )r6   r   r3   )r   r   r   )r   renamer!   r"   assert_frame_equal)r+   r,   resultexpecteds       r.   test_insert_column_bug_4032/TestDataFrameInsert.test_insert_column_bug_40320   s    c3Z()YYrY"
		!S1a&!2&q#hC1C:F
f/
		!S3*%2&m];_U
f/    c                     [        5       nUR                  SS/ SQSS9  UR                  SS/ SQSS9  UR                  SS/ SQSS9  [        / SQ/ S	Q/ S
Q// SQS9n[        R                  " X5        g )Nr   A)ghiT)allow_duplicates)def)r   r   r   )r   rD   r@   )r   rE   rA   )r   rF   rB   )r?   r?   r?   r4   )r   r!   r"   r8   )r+   r,   exps      r.   test_insert_with_columns_dups1TestDataFrameInsert.test_insert_with_columns_dupsA   sk    [
		!S/D	A
		!S/D	A
		!S/D	Ao?
 	b&r=   c                    [        [        R                  R                  S5      R	                  SSSS9SS9n[
        R                  " S 5         [        R                  " / SQ5      US	'   S S S 5        g ! , (       d  f       g = f)
Nr   r   d   )r   rK   )sizeInt64)dtype)r   r   r   r   )r   r   r   r   integersr"   assert_produces_warningarrayr+   r,   s     r.   test_insert_EA_no_warning-TestDataFrameInsert.test_insert_EA_no_warningL   sb     II!!!$--a8-DG
 ''-hhy)BsG .--s   A22
B c                     [        SS/SS/S.5      nSn[        R                  " [        US9   UR	                  SSU5        S S S 5        g ! , (       d  f       g = f)	Nr   r   r      )col1col2zJExpected a one-dimensional object, got a DataFrame with 2 columns instead.r   newcol)r   r&   r'   r(   r!   r*   s      r.   test_insert_frame%TestDataFrameInsert.test_insert_frameU   sP    AA78 Y 	 ]]:S1IIa2& 211s   A
Ac                     [        SSS/05      nUR                  [        R                  " S5      SS5        [        R
                  " U[        SS/SS/S.5      5        g )Nr   r   r   r   r   )r   r   )r   r!   r   int64r"   r8   rR   s     r.   test_insert_int64_loc)TestDataFrameInsert.test_insert_int64_loc_   sN    aV}%
		"((1+sA&
b)1a&1v,F"GHr=   c           	      V   [        S[        S5      4S/05      nUR                  SSS/5        [        SS//[        R                  " S[        S5      4S[
        4/5      S9n[        R                  " X5        US	 [        S[        S5      4S/05      n[        R                  " X5        g )Nr?   z
2024-01-01r   r   Br4   )r   r   r!   r   from_tuplesr   r"   r8   )r+   r,   r:   s      r.   +test_insert_delete_mixed_multiindex_columns?TestDataFrameInsert.test_insert_delete_mixed_multiindex_columnse   s     i56<=
		!S1#VH**y./#s<
 	b+ sGsIl$;<qcBC
b+r=    N)__name__
__module____qualname____firstlineno__r/   r;   rH   rS   rZ   r^   rc   __static_attributes__re   r=   r.   r	   r	      s&    .60"	'*'I,r=   r	   )__doc__numpyr   r&   pandasr   r   r   r   r   pandas._testing_testingr"   r	   re   r=   r.   <module>rp      s-       c, c,r=   