o
    %jM                      @   s  d Z ddlmZ ddlmZ ddlZddlZddlmZmZm	Z	 ddl
mZ ejdZejdZejdZejd	d
dg ddeg dg dg dg dg dg dgeg dddg ddfdddgg ddeg dg dg dg dg dge	jg dddgdg ddfgdd Zejdddgddggdd  Zed!d" Zeejd#d$ed%d&gd'dgfd(ee	d)d*gd'ddgfgejd+d,d-gd.d/ Zed0d1 Zd2d3 Zed4d5 Zed6d7 Zed8d9 Zed:d; Zed<d= ZdS )>zy
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
    )datetime)StringION)	DataFrameIndex
MultiIndexz=ignore:Passing a BlockManager to DataFrame:DeprecationWarningZpyarrow_xfailZpyarrow_skipzdata,kwargs,expectedz[foo,2,3,4,5
bar,7,8,9,10
baz,12,13,14,15
qux,12,13,14,15
foo2,12,13,14,15
bar2,12,13,14,15
)indexABCD)	index_colnames                  	   
               )foobarbazquxfoo2Zbar2r   namer   r	   r
   r   )r   columnsz_foo,one,2,3,4,5
foo,two,7,8,9,10
foo,three,12,13,14,15
bar,one,12,13,14,15
bar,two,12,13,14,15
   )index1index2r   r	   r
   r   )r   one)r   two)r   three)r   r*   )r   r+   r'   r(   r   c                 C   s*   | }|j t|fi |}t|| d S )N)read_csvr   tmassert_frame_equal)all_parsersdatakwargsexpectedparserresult r7   i/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/pandas/tests/io/parser/common/test_index.pytest_pass_names_with_index   s   9r9   r   c           
      C   sn   d}d |ddd  }g d}|}|jt||d |d}|jt||d}	d gd |	j_t||	 d S )Nzuindex1,index2,A,B,C,D
foo,one,2,3,4,5
foo,two,7,8,9,10
foo,three,12,13,14,15
bar,one,12,13,14,15
bar,two,12,13,14,15

r&   r$   )r   headerr   r   r   )joinsplitr.   r   r   r   r/   r0   )
requestr1   r   Zusing_infer_stringr2   Zheadless_datar   r5   r6   r4   r7   r7   r8   test_multi_index_no_level_namesX   s   r@   c                 C   s`   | }d}| t|}tg dg dg dg dg dgg dtg dd}t|| d S )NzgA,B,C,D
foo,one,2,3,4,5
foo,two,7,8,9,10
foo,three,12,13,14,15
bar,one,12,13,14,15
bar,two,12,13,14,15
r   r   r   r$   r)   r%   r   )r.   r   r   r   from_tuplesr/   r0   r1   r5   r2   r6   r4   r7   r7   r8   (test_multi_index_no_level_names_implicitr   s    rD   zdata,expected,headerza,babr%   za,b
c,d)rE   c)rF   d
round_tripTFc                 C   s:   | }|r
|j ddn|}|jt||d}t|| d S )NF)r   )r;   )Zto_csvr.   r   r/   r0   )r1   r2   r4   r;   rJ   r5   r6   r7   r7   r8   test_multi_index_blank_df   s   rK   c                 C   sL   | }d}|j t|dd}tg dg dg dgg dd}t|| d S )	Nz+ id c0 c1 c2
0 1 0 a b
1 2 0 c d
2 2 2 e f
 )sep)r   r&   r   rE   rF   )r&   r   r   rH   rI   )r   r   r   ef)z
Unnamed: 0idZc0c1c2rG   )r.   r   r   r/   r0   rC   r7   r7   r8   test_no_unnamed_index   s   rS   c                 C   sl   d}| }|j t|dd}tg dg dg dg dg dg dgg dtg dd	d
d}t|| d S )Nzgindex,A,B,C,D
foo,2,3,4,5
bar,7,8,9,10
baz,12,13,14,15
qux,12,13,14,15
foo,12,13,14,15
bar,12,13,14,15
r   r<   r   r   r   r$   r   r   r   r    r   r   r   r"   rA   r.   r   r   r   r/   r0   r1   r2   r5   r6   r4   r7   r7   r8   "test_read_duplicate_index_explicit   s   rW   c                 C   sd   d}| }| t|}tg dg dg dg dg dg dgg dtg dd}t|| d S )NzaA,B,C,D
foo,2,3,4,5
bar,7,8,9,10
baz,12,13,14,15
qux,12,13,14,15
foo,12,13,14,15
bar,12,13,14,15
r   r   r   r$   rT   rA   rU   rV   r7   r7   r8   "test_read_duplicate_index_implicit   s   
rX   c                 C   s   | }t j|d}|j|ddd}tg dg dg dg dg d	gg d
ttdddtdddtdddtdddtdddgd}t|| d S )Nz	test2.csvr   T)r   Zparse_dates)gA	]^?gֈ`|@g% TO׿gnIr   )g=HOC?gW\g~q"BĿg=4?r   )gZH?g7ne?g>ݦ4g_YiR?r   )g䞮X?gt]?gnk3Am?g-?r    )gP,߿g~W[I?gN6gFgZ&|?r!   )r   r	   r
   r   Ei  r&   r   r   r      r   rA   )	ospathr=   r.   r   r   r   r/   r0   )r1   Zcsv_dir_pathr5   Zcsv2r6   r4   r7   r7   r8   test_read_csv_no_index_name   s*   




r]   c                 C   s@   d}| }|j t|dd}tdgtg ddd}t|| d S )Nzx,yr   r<   yxr"   rA   rU   rV   r7   r7   r8   test_empty_with_index  s
   r`   c                 C   sP   d}| }|j t|ddgd}tdgtjg gd ddgdd}t|| d S )	Nx,y,zr_   r^   r<   zr   r-   rA   r.   r   r   r   Zfrom_arraysr/   r0   rV   r7   r7   r8   test_empty_with_multi_index  s   rd   c                 C   sP   d}| }|j t|ddgd}tdgtjg gd ddgd	d
}t|| d S )Nra   r&   r   r<   rb   r   r^   r_   r-   rA   rc   rV   r7   r7   r8   $test_empty_with_reversed_multi_index'  s   re   ) __doc__r   ior   r[   ZpytestZpandasr   r   r   Zpandas._testingZ_testingr/   markfilterwarningsZ
pytestmarkZusefixturesZxfail_pyarrowZskip_pyarrowZparametrizerB   r9   r@   rD   rK   rS   rW   rX   r]   r`   rd   re   r7   r7   r7   r8   <module>   s    

8

!	




