3
Êb_~  ã            	   @   sp  d dl Zd dlZd dlZd dljZdd„ Zej	dej
dejd�gd�dd„ ƒZd	d
„ ejej
gD ƒZejdd
„ ejej
gD ƒƒ ejdd
„ ejejejgD ƒƒ ejej
dCejd�gƒ ejd ddDgƒ ej	ed�dd„ ƒZej	ejejddd�ƒejejddd�ƒejejddd�ƒejdƒgdd„ d�dd„ ƒZej	ejdƒjƒ ejdƒejdƒjƒ gdd„ d�dd„ ƒZej	ejjdƒejjdƒejdd�jƒ ejd ƒej dd!ƒej dd"ƒgd#d„ d�d$d%„ ƒZ!ej	ejjd&ƒejj"d'ƒejd&d(�jƒ ejdEd*�ej d&d"ƒej d'd+ƒgd,d„ d�d-d.„ ƒZ#ejj$d&ƒejj%dƒejj"ƒ gZ&ej	ejd/d0�jƒ ej d/d1ƒejd/d*�ge& d�d2d3„ ƒZ'ej	ej d4d"ƒejd5d(�jƒ ejd6ƒge& d�d7d8„ ƒZ(ej	ej d9d!ƒejd9d�jƒ ejd9d�ge& d�d:d;„ ƒZ)ej	ejej*ej+ged�d<d=„ ƒZ,ej	ejej*ej-ej+ej.j/d>�ej0ged�d?d@„ ƒZ1ej	ejej*ej+ej0ged�dAdB„ ƒZ2e2Z3dS )Fé    Nc             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)Úx© r   úB/tmp/pip-build-jkwsxyiy/pandas/pandas/tests/arithmetic/conftest.pyÚid_func   s    
r   r   )Údtype)Úparamsc             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')
    )Úparam)Úrequestr   r   r   Úone   s    r   c             C   s4   g | ],}t jt jt jg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 )g        r   )r   g       €)r   r   )r   r   r   r   r   r   3   s    c             C   s   g | ]}t jd |d�‘qS )r   )r   )r   Úarray)r   r   r   r   r   r   5   s    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 = pd.RangeIndex(5)
    >>> arr / zeros
    Float64Index([nan, inf, inf, inf, inf], dtype='float64')
    )r   )r   r   r   r   Úzero:   s    r   r   r   r   r   c             C   s
   t | ƒjS )N)Útyper	   )r   r   r   r   Ú<lambda>Y   s    r   )r   Úidsc             C   s   | j S )z7
    Several types of numeric-dtypes Index objects
    )r   )r   r   r   r   Únumeric_idxR   s    r!   Z5m4sc             C   s
   t | ƒjS )N)r   r	   )r   r   r   r   r   l   s    c             C   s   | j S )zT
    Several variants of Timedelta scalars representing 5 minutes and 4 seconds
    )r   )r   r   r   r   Ú	scalar_tdf   s    r"   é   éH   )Údaysz72:00:00ÚDÚhc             C   s
   t | ƒjS )N)r   r	   )r   r   r   r   r   ~   s    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_daysu   s    r(   r   éx   )Úhoursi  )ÚsecondsÚmc             C   s
   t | ƒjS )N)r   r	   )r   r   r   r   r   ‘   s    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    r1   é   é   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    r4   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    r5   c             C   s   | j S )z‚
    Several array-like containers that should have effectively identical
    behavior with respect to arithmetic operations.
    )r   )r   r   r   r   ÚboxÕ   s    r6   )Zmarksc             C   s   | j S )zN
    Fixture equivalent to `box` fixture but xfailing the DataFrame case.
    )r   )r   r   r   r   Úbox_df_failÞ   s    r7   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    r8   g       €g       €i   )4Znumpyr   ZpytestZpandasÚpdZpandas._testingZ_testingÚtmr   Zfixturer   r   r   ÚIndexÚzerosÚextendr   r   r   ZFloat64IndexZarangeZ
Int64IndexZUInt64IndexZ
RangeIndexr!   Z	TimedeltaZto_pytimedeltaZto_timedelta64r"   ÚoffsetsZDayZHourZtimedelta64r(   ZMinuter-   Z	YearBeginZ
MonthBeginZ_common_mismatchr1   r4   r5   ZSeriesZ	DataFramer6   r   ÚmarkZxfailZto_arrayr7   r8   Zbox_with_array2r   r   r   r   Ú<module>   s†   
$ 
	















"		&
