U
    f/e                  
   @   s  d dl Zd dlZd dlZd dlmZmZmZmZ d dl	m
Z d dlmZ ejddd dgddgd	d
d Zdd Zejdejdejdgddd Zdd ejejejfD Zedd ejejfD  edd ejejejfD  eejdejdg ed ddg ejeddd Zejeejdddeejdddeejdddedgdd  d!d"d# Zejed$ ed$ed$ gd%d  d!d&d' Z ejej!"d(ej!#d)ejd(d* ed+e$d(d,e$d)d-gd.d  d!d/d0 Z%ejej!#d1ej!&d2ejd1d3 ejd4d5e$d1d-e$d2d6gd7d  d!d8d9 Z'ej!(d1ej!)dej!& gZ*ejejd:d; e$d:d<ejd:d5ge* dd=d> Z+eje$d?d-ejd@d3 edAge* ddBdC Z,eje$dDd,ejdDd* ejdDd*ge* ddEdF Z-ejejej.ej/ejged!dGdH Z0ejejej.ej1eje2ged!dIdJ Z3e0Z4dS )K    N)Float64Index
Int64Index
RangeIndexUInt64Index)expressionsTmodulei@B Znumexprpython)ZautouseZscopeparamsidsc                 c   s    t j}| jt _| jV  |t _d S N)expr_MIN_ELEMENTSparam)requestr    r   D/tmp/pip-unpacked-wheel-tiezk1ph/pandas/tests/arithmetic/conftest.pyswitch_numexpr_min_elements   s    r   c                 C   s>   t | tr4t| dkst| d jd t| d  S | jS d S )N   r   -   )
isinstancetuplelenAssertionError__name__strxr   r   r   id_func   s    
r   r   dtype)r	   c                 C   s   | j S )aL  
    Several variants of integer value 1. The zero-dim integer array
    behaves like an integer.

    This fixture can be used to check that datetimelike indexes handle
    addition and subtraction of integers and zero-dimensional arrays
    of integers.

    Examples
    --------
    >>> dti = pd.date_range('2016-01-01', periods=2, freq='H')
    >>> dti
    DatetimeIndex(['2016-01-01 00:00:00', '2016-01-01 01:00:00'],
    dtype='datetime64[ns]', freq='H')
    >>> dti + one
    DatetimeIndex(['2016-01-01 01:00:00', '2016-01-01 02:00:00'],
    dtype='datetime64[ns]', freq='H')
    r   r   r   r   r   one(   s    r#   c                 C   s4   g | ],}t jt jt jfD ]}|d gd |dqqS )r      r   )npint64uint64float64).0box_clsr    r   r   r   
<listcomp>?   s    r+   c                 C   s    g | ]}|d gd t jdqS )       r$   r   )r%   r(   )r)   r*   r   r   r   r+   E   s     c                 C   s   g | ]}t jd |dqS )r   r   )r%   array)r)   r    r   r   r   r+   G   s     r,   g        c                 C   s   | j S )a  
    Several types of scalar zeros and length 5 vectors of zeros.

    This fixture can be used to check that numeric-dtype indexes handle
    division by any zero numeric-dtype.

    Uses vector of length 5 for broadcasting with `numeric_idx` fixture,
    which creates numeric-dtype vectors also of length 5.

    Examples
    --------
    >>> arr = RangeIndex(5)
    >>> arr / zeros
    Float64Index([nan, inf, inf, inf, inf], dtype='float64')
    r!   r"   r   r   r   zeroL   s    r.   r$   r(   r&   r'   c                 C   s
   t | jS r   typer   r   r   r   r   <lambda>k       r1   )r	   r
   c                 C   s   | j S )z7
    Several types of numeric-dtypes Index objects
    r!   r"   r   r   r   numeric_idxd   s    r3   Z5m4sc                 C   s
   t | jS r   r/   r   r   r   r   r1   ~   r2   c                 C   s   | j S )zT
    Several variants of Timedelta scalars representing 5 minutes and 4 seconds
    r!   r"   r   r   r   	scalar_tdx   s    r4      H   )daysz72:00:00Dhc                 C   s
   t | jS r   r/   r   r   r   r   r1      r2   c                 C   s   | j S )za
    Several timedelta-like and DateOffset objects that each represent
    a 3-day timedelta
    r!   r"   r   r   r   
three_days   s    r:   r   x   )hoursi   )secondsmc                 C   s
   t | jS r   r/   r   r   r   r   r1      r2   c                 C   s   | j S )zb
    Several timedelta-like and DateOffset objects that each represent
    a 2-hour timedelta
    r!   r"   r   r   r   	two_hours   s    r?      )minutessc                 C   s   | j S )zp
    Several timedelta-like and DateOffset instances that are _not_
    compatible with Hourly frequencies.
    r!   r"   r   r   r   
not_hourly   s    rC         z23:00:00c                 C   s   | j S )zo
    Several timedelta-like and DateOffset instances that are _not_
    compatible with Daily frequencies.
    r!   r"   r   r   r   	not_daily   s    rF   im  c                 C   s   | j S )z{
    Several timedelta-like and DateOffset instances that are _not_
    compatible with Monthly or Annual frequencies.
    r!   r"   r   r   r   mismatched_freq   s    rG   c                 C   s   | j S )z]
    Fixture to test behavior for Index, Series, DataFrame, and pandas Array
    classes
    r!   r"   r   r   r   box_with_array   s    rH   c                 C   s   | j S )zc
    Fixture to test behavior for Index, Series, tm.to_array, numpy Array and list
    classes
    r!   r"   r   r   r   box_1d_array   s    rI   )5Znumpyr%   ZpytestZpandaspdr   r   r   r   Zpandas._testingZ_testingtmZpandas.core.computationr   r   Zfixturer   r   r-   r&   r#   ZIndexzerosextendr'   r(   r.   Zaranger3   Z	TimedeltaZto_pytimedeltaZto_timedelta64r4   offsetsZDayZHourZtimedelta64r:   ZMinuter?   Z	YearBeginZ
MonthBeginZ_common_mismatchrC   rF   rG   ZSeriesZ	DataFramerH   Zto_arraylistrI   Zbox_with_array2r   r   r   r   <module>   s      

 

	












	











	