U
    f/e                     @   s   d Z ddlmZ ddlZddlZddlmZ ddlm	Z	 ddl
mZ dd Zdd	 Zejd
dddgdd Zejdddg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.
    )StringION)is_platform_linux)	DataFramec                 C   sD   | }d}|j t|d d}tdd |dD g}t|| d S )Nz45e-1,4.5,45.,inf,-inf)headerc                 S   s   g | ]}t |qS  )float).0sr   r   L/tmp/pip-unpacked-wheel-tiezk1ph/pandas/tests/io/parser/common/test_float.py
<listcomp>   s     z%test_float_parser.<locals>.<listcomp>,)read_csvr   r   splittmassert_frame_equal)Zall_parsersparserdataresultexpectedr   r   r
   test_float_parser   s
    r   c                 C   sb   t dgdgdgdgd}|jdd}| \}}|dkr@t  |jt||d	}t|| d S )
NZ2eZ3EZ42eZ632E)wxyzF)indexpyarrowZfloat_precision)	r   	from_dictZto_csvpytestskipr   r   r   r   )all_parsers_all_precisionsZdfr   r   	precisionZdf_roundtripr   r   r
   test_scientific_no_exponent   s    r"   neg_expii`yl;c                 C   sR   | \}}|dkrt   d| }|jt||d}tddgi}t|| d S )Nr   data
10Er   r           )r   r   r   r   r   r   r   )r    r#   r   r!   r   r   r   r   r   r
   test_very_negative_exponent&   s    
r&   exp   NZolNZoc           
      C   s   | \}}d| }|j t||d}|dkrv|dkrTt rTtjjdd}|j| |dkrbtj	nd}t
d	|gi}	nt
d	d
| gi}	t||	 d S )Nr$   r   Z
round_tripr(   z%GH38794, on Linux gives object result)reasonr   r%   r   Z10E)r   r   r   r   markZxfailnodeZ
add_markernpinfr   r   r   )
r    r'   requestr   r!   r   r   r*   valuer   r   r   r
   test_too_many_exponent_digits2   s    
r0   )__doc__ior   Znumpyr,   r   Zpandas.compatr   Zpandasr   Zpandas._testingZ_testingr   r   r"   r*   Zparametrizer&   r0   r   r   r   r
   <module>   s   

