B
    x\                 @   s,  d dl Zd dlZd dlmZmZmZmZ d dlm	  m
Z ejdd Zejdd Zejdd Zejd	d
 Zejdd Zejdd Zejdd Zejdd Zejdd Zejdd Zejdd Zejdd Zejdd Zejdd Zejdd  Zejd!d" Zejd#d$ ZdS )%    N)	DataFrameNaTcompat
date_rangec               C   s   t t S )zm
    Fixture for DataFrame of floats with index of unique strings

    Columns are ['A', 'B', 'C', 'D'].
    )r   tmgetSeriesData r   r   :lib/python3.7/site-packages/pandas/tests/frame/conftest.pyfloat_frame   s    r
   c              C   s8   t t } tj| jdd< tj| jddddf< | S )z
    Fixture for DataFrame of floats with index of unique strings

    Columns are ['A', 'B', 'C', 'D']; some entries are missing
       
         N)r   r   r   npnanloc)dfr   r   r	   float_frame_with_na   s    r   c               C   s   t t ddddgdS )zl
    Fixture for DataFrame of floats with index of unique strings

    Columns are ['D', 'C', 'B', 'A']
    DCBA)columns)r   r   r   r   r   r   r	   float_frame2    s    r   c              C   sF   t t dk} | t} tj| jdd< tj| jddddf< | S )z
    Fixture for DataFrame of booleans with index of unique strings

    Columns are ['A', 'B', 'C', 'D']; some entries are missing
    r   r   r   r   r   r   N)r   r   r   astypeobjectr   r   r   )r   r   r   r	   bool_frame_with_na*   s
    
r   c              C   s:   t dd tt D } t dd t| D tjdS )zj
    Fixture for DataFrame of ints with index of unique strings

    Columns are ['A', 'B', 'C', 'D']
    c             S   s   i | ]\}}| t|qS r   )r   int).0kvr   r   r	   
<dictcomp>@   s   zint_frame.<locals>.<dictcomp>c             S   s   i | ]\}}||qS r   r   )r   csr   r   r	   r"   C   s    )dtype)r   r   	iteritemsr   r   r   int64)r   r   r   r	   	int_frame9   s    r(   c               C   s   t t S )zb
    Fixture for DataFrame of floats with DatetimeIndex

    Columns are ['A', 'B', 'C', 'D']
    )r   r   ZgetTimeSeriesDatar   r   r   r	   datetime_frameF   s    r)   c              C   s   t t } d| d< | S )z
    Fixture for DataFrame of floats and strings with index of unique strings

    Columns are ['A', 'B', 'C', 'D', 'foo'].
    barfoo)r   r   r   )r   r   r   r	   float_string_frameP   s    r,   c              C   sH   t t } | jd| _| jd| _| jd| _| jd| _| S )z|
    Fixture for DataFrame of different float types with index of unique strings

    Columns are ['A', 'B', 'C', 'D'].
    float32float16float64)r   r   r   r   r   r   r   r   )r   r   r   r	   mixed_float_frame\   s    r0   c              C   sH   t t } | jd| _| jd| _| jd| _| jd| _| S )z|
    Fixture for DataFrame of different float types with index of unique strings

    Columns are ['A', 'B', 'C', 'D'].
    r-   r.   r/   )r   r   r   r   r   r   r   )r   r   r   r	   mixed_float_frame2k   s    r1   c              C   s`   t dd tt D } | jd| _tjt	| j
dd| _
| jd| _| jd| _| S )zz
    Fixture for DataFrame of different int types with index of unique strings

    Columns are ['A', 'B', 'C', 'D'].
    c             S   s   i | ]\}}| t|qS r   )r   r   )r   r    r!   r   r   r	   r"      s   z#mixed_int_frame.<locals>.<dictcomp>int32Zuint64)r%   Zuint8r'   )r   r   r&   r   r   r   r   r   Zoneslenr   r   r   )r   r   r   r	   mixed_int_framez   s    r4   c            	   C   s>   t dddtjdgd ddtjdgd ddd	tdd
S )z
    Fixture for DataFrame of float/int/string columns with RangeIndex

    Columns are ['a', 'b', 'c', 'float32', 'int32'].
    g      ?   r+   r   r-   )r%      r2   )abr#   r-   r2   )index)r   r   arrayZaranger   r   r   r	   mixed_type_frame   s    r;   c              C   sD   t tdddtddddtddddd} t| jd< t| jd	< | S )
z
    Fixture for DataFrame of date_range Series with different time zones

    Columns are ['A', 'B', 'C']; some entries are missing
    Z20130101   )periodsz
US/Eastern)r=   ZtzZCET)r   r   r   )r6   r6   )r6   r5   )r   r   r   Ziloc)r   r   r   r	   timezone_frame   s    

r>   c               C   s   t i S )z%
    Fixture for empty DataFrame
    )r   r   r   r   r	   empty_frame   s    r?   c               C   s   t jddS )z9
    Fixture for Series of floats with DatetimeIndex
       )nper)r   makeTimeSeriesr   r   r   r	   datetime_series   s    rC   c               C   s   t jdddd S )z9
    Fixture for Series of floats with DatetimeIndex
    r@   )rA   r   N)r   rB   r   r   r   r	   datetime_series_short   s    rD   c              C   s<   t dddgdddgddd	gg} t| d
ddgdddgdS )zn
    Fixture for simple 3x3 DataFrame

    Columns are ['one', 'two', 'three'], index is ['a', 'b', 'c'].
    g      ?g       @g      @g      @g      @g      @g      @g       @g      "@onetwothreer7   r8   r#   )r   r9   )r   r:   r   )Zarrr   r   r	   simple_frame   s
    rH   c           	   C   sP   t dddddgdddddgdddd	d
gtjdtjdtjdd} | S )z
    Fixture for DataFrame of columns that can be used for indexing

    Columns are ['A', 'B', 'C', 'D', 'E', ('tuple', 'as', 'label')];
    'A' & 'B' contain duplicates (but are jointly unique), the rest are unique.
    r+   r*   rE   rF   rG   r7   r8   r#   der   )r   r   r   r   E)tupleasZlabel)r   r   ZrandomZrandn)r   r   r   r	   frame_of_index_cols   s    

rN   )Znumpyr   ZpytestZpandasr   r   r   r   Zpandas.util.testingutilZtestingr   Zfixturer
   r   r   r   r(   r)   r,   r0   r1   r4   r;   r>   r?   rC   rD   rH   rN   r   r   r   r	   <module>   s(   


