3
®ybqz  ã               @   s
  d Z ddlmZ ddlmZmZmZmZ ddlm	Z	 ddl
Z
ddlZddlmZmZ ddlZddlmZ ddlZddlZddlmZmZ ddljjZddlZdd	lmZ ddlj Z!dd
l"m#Z# ddl$m%Z%m&Z& dd„ Z'dd„ Z(dd„ Z)ej*j+ddej,j-fd� ej*j.dƒ xFdj/ƒ D ]:Z0e1ej2j3e0ƒZ4ej5e4ej6e4ej7�d-dƒej8ƒ d�ƒ �qW xRdj/ƒ D ]FZ0e1ej2j3e0ƒZ4ej5e4ej6e4ej7�d.dƒej8ƒ ej7ddd�d�ƒ �q\W xRdj/ƒ D ]FZ0e1ej2j3e0ƒZ4ej5e4ej6e4ej7�d/dƒej8ƒ ej7ddd�d �ƒ �q°W ej9d!d"�d#d$„ ƒZ:ej9d!d"�d%d&„ ƒZ;ej9ddd'd(gd)d*„ d+�d,d-„ ƒZ<e<Z=ej9dd'gd.d*„ d+�d/d0„ ƒZ>ej9d!d1dgd2�d3d4„ ƒZ?ej9d!d1dgd2�d5d6„ ƒZ@ej9d7d8d1gd2�d9d:„ ƒZAej9d;d<d=d>gd2�d?d@„ ƒZBej9d;d<d=d>gd2�dAdB„ ƒZCej9ddCdDdEdFgd2�dGdH„ ƒZDej9dCdDdEdFgd2�dIdJ„ ƒZEej9d!d1gd2�dKdL„ ƒZFej9dMdNd;d<gd2�dOdP„ ƒZGej9dQdRgd2�dSdT„ ƒZHej9dejIejJeKdUƒejLgeMd+�dVdW„ ƒZNeNZOej9dejIejJgd2�dXdY„ ƒZPePZQej9ej%ejRgd'dZgd+�d[d\„ ƒZSeSZTej9d]d^„ ƒZUej9d_d`„ ƒZVej9dadb„ ƒZWdcdd„ ZXdedf„ ZYe!jZdgƒe!j[dgƒe!j\dgƒe!j\dgdhdi�e!j]dgƒe!j^dgƒe!j_dgƒe!j`dgƒe!jadgƒe!jbdgƒe!jcdjƒe!jddgƒe!jedgƒe%g ƒe&jfegdkdldmgddndogƒƒeYƒ eXƒ e%dddddndngƒdpœZhej9ehjiƒ d2�dqd'„ ƒZjejZkej9drds„ ƒZlej9dtdu„ ƒZmej9dvdw„ ƒZnej9dxdy„ ƒZodzd{„ Zpd|d}„ ehjqƒ D ƒZrej9d~d„ ƒZsejtejuejvejwejxejyejzej{gZ|d€d}„ e|D ƒZ}ej9e}jiƒ d2�d�d‚„ ƒZ~ehere}–Zej9ejiƒ d2�dƒd„„ ƒZ€ej9d…d†„ ƒZ�ej9d‡dˆ„ ƒZ‚ej9d‰dŠ„ ƒZƒej9d‹dŒ„ ƒZ„d�dŽd�d�d‘d’d“d”d•d–d—d˜d™dšgZ…ej9e…d2�d›dœ„ ƒZ†ej9e
j‡e#jˆe
j‰e#jŠe
j‹e#jŒe
j�e#jŽe
j�e#j�e
j‘e#j’e
j“e#j”gd2�d�dž„ ƒZ•dŸd d¡d¢d£d¤d¥d¦d§d¨g
Z–ej9e–d2�d©dª„ ƒZ—d«d¬gZ˜ej9e˜d2�d­d®„ ƒZ™e–e˜ Zšej9ešd2�d¯d°„ ƒZ›ej9d±d²d³d´dµd¶gd2�d·d¸„ ƒZœej9d³d´dµd¶gd2�d¹dº„ ƒZ�ej9d»d¼d½d¾d¿dÀgd2�dÁdÂ„ ƒZžej9dÃdÄ„ ƒZŸej9dÅdÆ„ ƒZ ej9dÇdÈ„ ƒZ¡ddÉdÊdËdÌdÍeƒ eƒ edÎƒedƒe�d0ƒejeeddÏ�ƒee�d1dÏ�dkdÐ�gZ¢dÑdÒ„ e¢D ƒZ£ej¤eMe£ƒƒej9e¢e£d+�dÓdÔ„ ƒƒZ¥ej¤eMe£dd… ƒƒej9e¢dd… e£dd… d+�dÕdÖ„ ƒƒZ¦e¦Z§ej9d×dØ�dÙdÚ„ ƒZ¨ej9dÛdÜeeƒ ejgd2�dÝdÞ„ ƒZ©ej9e!jªd2�dßdà„ ƒZ«ej9e!j¬d2�dádâ„ ƒZ­ej9e!j®d2�dãdä„ ƒZ¯ej9e!j°d2�dådæ„ ƒZ±ej9e!j²d2�dçdè„ ƒZ³ej9e!j´d2�dédê„ ƒZµej9e!j¶d2�dëdì„ ƒZ·ej9e!j¸d2�dídî„ ƒZ¹ej9e!jºd2�dïdð„ ƒZ»ej9e!j¼d2�dñdò„ ƒZ½ej9e!j¾d2�dódô„ ƒZ¿ej9e!jÀd2�dõdö„ ƒZÁej9e!jÂd2�d÷dø„ ƒZÃej9e!jÄd2�dùdú„ ƒZÅdûdüejIdýgfdûdüejLdýgfdþdÿejI�d gf�dejIejIejIgf�dg f�ddüejIdngf�ddüejI�dgf�d�dejI�dgf�ddejIdngf�ddejI�dgf�d	e	dƒejIe	dnƒgf�d
d!ejId1gf�d
d!ejLd1gf�dejÆ�dƒejIejÆ�dƒgf�dejÇ�dƒejIejÇ�dƒgf�de�dddƒejIe�dddƒgf�dedƒejIednƒgf�dedƒejIednƒgf�dejÈ�dƒejJejÈ�dƒgf�dejÉddƒejIejÉddnƒgfgZÊegeÊŽ \ZËZÌej9eÊeËd+��d�d„ ƒZÍej9�d�d„ ƒZÎej9�d�d�d�d�d �d!�d"gd2��d#�d$„ ƒZÏej9eÐe!jÑƒd2��d%�d&„ ƒZÒej9�d'dÒ„ ej3jÓD ƒd2��d(�d)„ ƒZÔej9d�d*d*„ gd2��d+�d,„ ƒZÕdS (2  a•  
This file is very long and growing, but it was decided to not split it yet, as
it's still manageable (2020-03-17, ~1.1k LoC). See gh-31989

Instead of splitting it was decided to define sections here:
- Configuration / Settings
- Autouse fixtures
- Common arguments
- Missing values & co.
- Classes
- Indices
- Series'
- DataFrames
- Operators & Operations
- Data sets/files
- Time zones
- Dtypes
- Misc
é    )Úabc)ÚdateÚtimeÚ	timedeltaÚtimezone)ÚDecimalN)ÚtzlocalÚtzutc)Ú
strategies)ÚFixedOffsetÚutc)Ú	DataFrame)Úops)ÚIndexÚ
MultiIndexc             C   sL   | j ddƒ | j ddƒ | j ddƒ | j ddƒ | j ddƒ | j ddƒ d S )NÚmarkersz&single: mark a test as single cpu onlyzslow: mark a test as slowznetwork: mark a test as networkz2db: tests requiring a database (mysql or postgres)z.high_memory: mark a test as a high-memory onlyz(clipboard: mark a pd.read_clipboard test)Zaddinivalue_line)Úconfig© r   ú3/tmp/pip-install-4cy230dp/pandas/pandas/conftest.pyÚpytest_configure/   s    r   c             C   sd   | j dddd� | j dddd� | j dddd� | j d	dd
d� | j dddd� | j dddd� d S )Nz--skip-slowÚ
store_truezskip slow tests)ÚactionÚhelpz--skip-networkzskip network testsz	--skip-dbzskip db testsz--run-high-memoryzrun high memory testsz--only-slowzrun only slow testsz--strict-data-filesz0Fail if a test is skipped for missing data file.)Z	addoption)Úparserr   r   r   Úpytest_addoption<   s    r   c             C   s¦   d| j kr | jjdƒr tjdƒ d| j kr@| jjdƒr@tjdƒ d| j kr`| jjdƒr`tjdƒ d	| j kr€| jjd
ƒr€tjdƒ d| j kr¢| jjdƒ r¢tjdƒ d S )NZslowz--skip-slowzskipping due to --skip-slowz--only-slowzskipping due to --only-slowÚnetworkz--skip-networkzskipping due to --skip-networkÚdbz	--skip-dbzskipping due to --skip-dbZhigh_memoryz--run-high-memoryz=skipping high memory test since --run-high-memory was not set)Úkeywordsr   Ú	getoptionÚpytestÚskip)Úitemr   r   r   Úpytest_runtest_setupK   s    



r"   Úciiô  )ÚdeadlineZsuppress_health_checkz)MonthBegin MonthEnd BMonthBegin BMonthEndéc   )ÚnÚ	normalizez%YearBegin YearEnd BYearBegin BYearEndé   é   é   )Z	min_valueZ	max_value)r&   r'   Úmonthz1QuarterBegin QuarterEnd BQuarterBegin BQuarterEndé   )r&   r'   ZstartingMonthT)Zautousec               C   s   t jddƒ dS )z<
    Configure settings for all tests and test modules.
    Zchained_assignmentÚraiseN)ÚpdZ
set_optionr   r   r   r   Úconfigure_tests�   s    r/   c             C   s   t | d< t| d< dS )z:
    Make `np` and `pd` names available for doctests.
    Únpr.   N)r0   r.   )Zdoctest_namespacer   r   r   Úadd_imports—   s    r1   ÚindexÚcolumnsc             C   s   dt | ƒ› �S )Nzaxis )Úrepr)Úxr   r   r   Ú<lambda>£   s    r6   )ÚparamsÚidsc             C   s   | j S )z@
    Fixture for returning the axis numbers of a DataFrame.
    )Úparam)Úrequestr   r   r   Úaxis£   s    r;   c             C   s   dt | ƒ› �S )Nzaxis )r4   )r5   r   r   r   r6   ®   s    c             C   s   | j S )z=
    Fixture for returning the axis numbers of a Series.
    )r9   )r:   r   r   r   Úaxis_series®   s    r<   F)r7   c             C   s   | j S )a…  
    Pass in the observed keyword to groupby for [True, False]
    This indicates whether categoricals should return values for
    values which are not in the grouper [False / None], or only values which
    appear in the grouper [True]. [None] is supported for future compatibility
    if we decide to change the default (and would need to warn if this
    parameter is not passed).
    )r9   )r:   r   r   r   Úobserved¶   s    
r=   c             C   s   | j S )z6
    Boolean 'ordered' parameter for Categorical.
    )r9   )r:   r   r   r   ÚorderedÃ   s    r>   ÚfirstÚlastc             C   s   | j S )z[
    Valid values for the 'keep' parameter used in
    .duplicated or .drop_duplicates
    )r9   )r:   r   r   r   ÚkeepË   s    rA   ÚleftÚrightZbothZneitherc             C   s   | j S )z<
    Fixture for trying all interval closed parameters.
    )r9   )r:   r   r   r   ÚclosedÔ   s    rD   c             C   s   | j S )zS
    Secondary closed fixture to allow parametrizing over all pairs of closed.
    )r9   )r:   r   r   r   Úother_closedÜ   s    rE   ÚgzipÚbz2ÚzipÚxzc             C   s   | j S )zK
    Fixture for trying common compression types in compression tests.
    )r9   )r:   r   r   r   Úcompressionä   s    rJ   c             C   s   | j S )zk
    Fixture for trying common compression types in compression tests excluding
    uncompressed case.
    )r9   )r:   r   r   r   Úcompression_onlyì   s    rK   c             C   s   | j S )z,
    Fixture that an array is writable.
    )r9   )r:   r   r   r   Úwritableõ   s    rL   ÚinnerÚouterc             C   s   | j S )z:
    Fixture for trying all types of join operations.
    )r9   )r:   r   r   r   Ú	join_typeý   s    rO   ÚnlargestÚ	nsmallestc             C   s   | j S )z1
    Fixture for trying all nselect methods.
    )r9   )r:   r   r   r   Únselect_method  s    rR   Únanc             C   s   | j S )z/
    Fixture for each null type in pandas.
    )r9   )r:   r   r   r   Únulls_fixture  s    rT   c             C   s   | j S )zL
    Fixture for each null type in pandas, each null type exactly once.
    )r9   )r:   r   r   r   Úunique_nulls_fixture  s    rU   Úseriesc             C   s   | j S )zÑ
    Fixture to parametrize over Index and Series, made necessary by a mypy
    bug, giving an error:

    List item 0 has incompatible type "Type[Series]"; expected "Type[PandasObject]"

    See GH#29725
    )r9   )r:   r   r   r   Úindex_or_series*  s    
rW   c              C   s   G dd„ dt ƒ} | S )z,
    Fixture for a dictionary subclass.
    c               @   s   e Zd Zdd„ ZdS )z"dict_subclass.<locals>.TestSubDictc             _   s   t j| f|ž|Ž d S )N)ÚdictÚ__init__)ÚselfÚargsÚkwargsr   r   r   rY   B  s    z+dict_subclass.<locals>.TestSubDict.__init__N)Ú__name__Ú
__module__Ú__qualname__rY   r   r   r   r   ÚTestSubDictA  s   r`   )rX   )r`   r   r   r   Údict_subclass;  s    ra   c              C   s   G dd„ dt jƒ} | S )z8
    Fixture for a non-mapping dictionary subclass.
    c               @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
z5non_dict_mapping_subclass.<locals>.TestNonDictMappingc             S   s
   || _ d S )N)Ú_data)rZ   Zunderlying_dictr   r   r   rY   O  s    z>non_dict_mapping_subclass.<locals>.TestNonDictMapping.__init__c             S   s   | j j|ƒS )N)rb   Ú__getitem__)rZ   Úkeyr   r   r   rc   R  s    zAnon_dict_mapping_subclass.<locals>.TestNonDictMapping.__getitem__c             S   s
   | j jƒ S )N)rb   Ú__iter__)rZ   r   r   r   re   U  s    z>non_dict_mapping_subclass.<locals>.TestNonDictMapping.__iter__c             S   s
   | j jƒ S )N)rb   Ú__len__)rZ   r   r   r   rf   X  s    z=non_dict_mapping_subclass.<locals>.TestNonDictMapping.__len__N)r]   r^   r_   rY   rc   re   rf   r   r   r   r   ÚTestNonDictMappingN  s   rg   )r   ÚMapping)rg   r   r   r   Únon_dict_mapping_subclassH  s    ri   c              C   sb   t jdƒ} | jdd„ dd„ dd„ gƒjƒ }|jjdd„ |jjD ƒdd	� |jjd
ddgdd	� |S )z„
    DataFrame with 3 level MultiIndex (year, month, day) covering
    first 100 business days from 2000-01-01 with random data
    éd   c             S   s   | j S )N)Úyear)r5   r   r   r   r6   h  s    zAmultiindex_year_month_day_dataframe_random_data.<locals>.<lambda>c             S   s   | j S )N)r+   )r5   r   r   r   r6   h  s    c             S   s   | j S )N)Úday)r5   r   r   r   r6   h  s    c             S   s   g | ]}|j d ƒ‘qS )Úi8)Úastype)Ú.0Zlevr   r   r   ú
<listcomp>j  s    zCmultiindex_year_month_day_dataframe_random_data.<locals>.<listcomp>T)Zinplacerk   r+   rl   )ÚtmZmakeTimeDataFrameÚgroupbyÚsumr2   Z
set_levelsÚlevelsZ	set_names)ZtdfZymdr   r   r   Ú/multiindex_year_month_day_dataframe_random_dataa  s
    
 ru   c              C   sl   t ddddgƒ} t ddgƒ}tjdddd	d
d
gƒ}tjddddddgƒ}ddg}t| |g||g|dd�}|S )zJ
    MultiIndex used to test the general functionality of this object
    ÚfooÚbarÚbazZquxÚoneÚtwor   r)   é   é   r?   ÚsecondF)rt   ÚcodesÚnamesZverify_integrity)r   r0   Úarrayr   )Z
major_axisZ
minor_axisZmajor_codesZminor_codesZindex_namesÚmir   r   r   Ú_create_multiindexo  s    r‚   c               C   s.   t jddgddgtjdddd�gd	d
dgd�S )zB
    MultiIndex with a level that is a tzaware DatetimeIndex.
    r)   r{   ÚaÚbÚ20130101r|   z
US/Eastern)ZperiodsÚtzry   rz   Zthree)r   )r   Zfrom_productr.   Z
date_ranger   r   r   r   Ú_create_mi_with_dt64tz_level„  s    r‡   rj   z
US/Pacific)r†   é
   rv   rw   rx   r{   r|   )ÚunicodeÚstringÚdatetimezdatetime-tzÚperiodr   ÚintZuintÚrangeÚfloatÚboolZcategoricalÚintervalÚemptyZtupleszmi-with-dt64tz-levelZmultiZrepeatsc             C   s   t | j jƒ S )zØ
    Fixture for many "simple" kinds of indices.

    These indices are unlikely to cover corner cases, e.g.
        - no names
        - no NaTs/NaNs
        - no values near implementation bounds
        - ...
    )Úindices_dictr9   Úcopy)r:   r   r   r   r2   ¥  s    c               C   s   t jg g tjd�S )N)r2   Údtype)r.   ÚSeriesr0   Zfloat64r   r   r   r   Úempty_series»  s    r—   c              C   s   t jƒ } d| _| S )zC
    Fixture for Series of floats with Index of unique strings
    rV   )rq   ZmakeStringSeriesÚname)Úsr   r   r   Ústring_seriesÀ  s    rš   c              C   s   t jƒ } d| _| S )zI
    Fixture for Series of dtype object with Index of unique strings
    Zobjects)rq   ZmakeObjectSeriesr˜   )r™   r   r   r   Úobject_seriesÊ  s    r›   c              C   s   t jƒ } d| _| S )z9
    Fixture for Series of floats with DatetimeIndex
    Úts)rq   ZmakeTimeSeriesr˜   )r™   r   r   r   Údatetime_seriesÔ  s    r�   c             C   s$   t | ƒ}tjj|ƒ}tj|| dd�S )z Helper for the _series dict rƒ   )r2   r˜   )Úlenr0   ÚrandomZrandnr.   r–   )r2   ÚsizeÚdatar   r   r   Ú_create_seriesÞ  s    r¢   c             C   s"   i | ]\}}t |ƒd |› d�“qS )zseries-with-z-index)r¢   )ro   Zindex_idr2   r   r   r   ú
<dictcomp>å  s   r£   c             C   s   t | ƒS )zE
    Fixture for tests on series with changing types of indices.
    )r¢   )r2   r   r   r   Úseries_with_simple_indexë  s    r¤   c             C   s(   i | ] }t jd d�j|ƒ|j› d�“qS )rƒ   )r˜   z-series)rq   ZmakeFloatSeriesrn   r]   )ro   r•   r   r   r   r£   ý  s   c             C   s   t | j jƒ S )z:
    Fixture for Series with low precision data types
    )Ú_narrow_seriesr9   r”   )r:   r   r   r   Únarrow_series  s    r¦   c             C   s   t | j jdd�S )z|
    Fixture for tests on indexes, series and series with a narrow dtype
    copy to avoid mutation, e.g. setting .name
    T)Údeep)Ú_index_or_series_objsr9   r”   )r:   r   r   r   Úindex_or_series_obj  s    r©   c               C   s   t ƒ S )N)r   r   r   r   r   Úempty_frame  s    rª   c               C   s   t tjƒ ƒjdƒS )a6  
    Fixture for DataFrame of ints with index of unique strings

    Columns are ['A', 'B', 'C', 'D']

                A  B  C  D
    vpBeWjM651  1  0  1  0
    5JyxmrP1En -1  0  0  0
    qEDaoD49U2 -1  1  0  0
    m66TkTfsFe  0  0  0  0
    EHPaNzEUFm -1  0 -1  0
    fpRJCevQhi  2  0  0  0
    OlQvnmfi3Q  0  0 -2  0
    ...        .. .. .. ..
    uB1FPlz4uP  0  0  0  1
    EcSe6yNzCU  0  0 -1  0
    L50VudaiI8 -1  1 -2  0
    y3bpw4nwIp  0 -1  0  0
    H0RdLLwrCT  1  1  0  0
    rY82K0vMwm  0  0  0  0
    1OPIUjnkjk  2  0  0  0

    [30 rows x 4 columns]
    Zint64)r   rq   ÚgetSeriesDatarn   r   r   r   r   Ú	int_frame   s    r¬   c               C   s   t tjƒ ƒS )aî  
    Fixture for DataFrame of floats with DatetimeIndex

    Columns are ['A', 'B', 'C', 'D']

                       A         B         C         D
    2000-01-03 -1.122153  0.468535  0.122226  1.693711
    2000-01-04  0.189378  0.486100  0.007864 -1.216052
    2000-01-05  0.041401 -0.835752 -0.035279 -0.414357
    2000-01-06  0.430050  0.894352  0.090719  0.036939
    2000-01-07 -0.620982 -0.668211 -0.706153  1.466335
    2000-01-10 -0.752633  0.328434 -0.815325  0.699674
    2000-01-11 -2.236969  0.615737 -0.829076 -1.196106
    ...              ...       ...       ...       ...
    2000-02-03  1.642618 -0.579288  0.046005  1.385249
    2000-02-04 -0.544873 -1.160962 -0.284071 -1.418351
    2000-02-07 -2.656149 -0.601387  1.410148  0.444150
    2000-02-08 -1.201881 -1.289040  0.772992 -1.445300
    2000-02-09  1.377373  0.398619  1.008453 -0.928207
    2000-02-10  0.473194 -0.636677  0.984058  0.511519
    2000-02-11 -0.965556  0.408313 -1.312844 -0.381948

    [30 rows x 4 columns]
    )r   rq   ZgetTimeSeriesDatar   r   r   r   Údatetime_frame=  s    r­   c               C   s   t tjƒ ƒS )aù  
    Fixture for DataFrame of floats with index of unique strings

    Columns are ['A', 'B', 'C', 'D'].

                       A         B         C         D
    P7GACiRnxd -0.465578 -0.361863  0.886172 -0.053465
    qZKh6afn8n -0.466693 -0.373773  0.266873  1.673901
    tkp0r6Qble  0.148691 -0.059051  0.174817  1.598433
    wP70WOCtv8  0.133045 -0.581994 -0.992240  0.261651
    M2AeYQMnCz -1.207959 -0.185775  0.588206  0.563938
    QEPzyGDYDo -0.381843 -0.758281  0.502575 -0.565053
    r78Jwns6dn -0.653707  0.883127  0.682199  0.206159
    ...              ...       ...       ...       ...
    IHEGx9NO0T -0.277360  0.113021 -1.018314  0.196316
    lPMj8K27FA -1.313667 -0.604776 -1.305618 -0.863999
    qa66YMWQa5  1.110525  0.475310 -0.747865  0.032121
    yOa0ATsmcE -0.431457  0.067094  0.096567 -0.264962
    65znX3uRNG  1.528446  0.160416 -0.109635 -0.032987
    eCOBvKqf3e  0.235281  1.622222  0.781255  0.392871
    xSucinXxuV -1.263557  0.252799 -0.552247  0.400426

    [30 rows x 4 columns]
    )r   rq   r«   r   r   r   r   Úfloat_frameZ  s    r®   Ú__add__Ú__radd__Ú__sub__Ú__rsub__Ú__mul__Ú__rmul__Ú__floordiv__Ú__rfloordiv__Ú__truediv__Ú__rtruediv__Ú__pow__Ú__rpow__Ú__mod__Ú__rmod__c             C   s   | j S )zD
    Fixture for dunder names for common arithmetic operations.
    )r9   )r:   r   r   r   Úall_arithmetic_operatorsŒ  s    r½   c             C   s   | j S )z¬
    Fixture for operator and roperator arithmetic functions.

    Notes
    -----
    This includes divmod and rdivmod, whereas all_arithmetic_operators
    does not.
    )r9   )r:   r   r   r   Úall_arithmetic_functions”  s    r¾   rs   ÚmaxÚminZmeanÚprodZstdÚvarZmedianZkurtZskewc             C   s   | j S )z.
    Fixture for numeric reduction names.
    )r9   )r:   r   r   r   Úall_numeric_reductionsÀ  s    rÃ   ÚallÚanyc             C   s   | j S )z.
    Fixture for boolean reduction names.
    )r9   )r:   r   r   r   Úall_boolean_reductionsË  s    rÆ   c             C   s   | j S )z>
    Fixture for all (boolean + numeric) reduction names.
    )r9   )r:   r   r   r   Úall_reductionsÖ  s    rÇ   Ú__eq__Ú__ne__Ú__le__Ú__lt__Ú__ge__Ú__gt__c             C   s   | j S )zu
    Fixture for dunder names for common compare operations

    * >=
    * >
    * ==
    * !=
    * <
    * <=
    )r9   )r:   r   r   r   Úall_compare_operatorsÞ  s    rÎ   c             C   s   | j S )zm
    Fixture for dunder names for compare operations except == and !=

    * >=
    * >
    * <
    * <=
    )r9   )r:   r   r   r   Úcompare_operators_no_eq_neí  s    
rÏ   Ú__and__Ú__rand__Ú__or__Ú__ror__Ú__xor__Ú__rxor__c             C   s   | j S )zY
    Fixture for dunder names for common logical operations

    * |
    * &
    * ^
    )r9   )r:   r   r   r   Úall_logical_operatorsú  s    rÖ   c             C   s
   | j dƒS )zO
    Returns the configuration for the test setting `--strict-data-files`.
    z--strict-data-files)r   )Zpytestconfigr   r   r   Ústrict_data_files  s    r×   c                s(   t jjt jjtƒdƒ‰ ‡ ‡fdd„}|S )a=  
    Get the path to a data file.

    Parameters
    ----------
    path : str
        Path to the file, relative to ``pandas/tests/``

    Returns
    -------
    path including ``pandas/tests``.

    Raises
    ------
    ValueError
        If the path doesn't exist and the --strict-data-files option is set.
    Útestsc                 sJ   t jjˆ f| žŽ }t jj|ƒsFˆr4td|› d�ƒ‚ntjd|› d�ƒ |S )NzCould not find file z  and --strict-data-files is set.zCould not find Ú.)ÚosÚpathÚjoinÚexistsÚ
ValueErrorr   r    )r[   rÛ   )Ú	BASE_PATHr×   r   r   Údeco(  s    zdatapath.<locals>.deco)rÚ   rÛ   rÜ   ÚdirnameÚ__file__)r×   rà   r   )rß   r×   r   Údatapath  s    rã   c             C   s   t j| ddddƒƒS )z*
    The iris dataset as a DataFrame.
    Úior¡   Úcsvziris.csv)r.   Zread_csv)rã   r   r   r   Úiris6  s    ræ   ÚUTCz
US/Easternz
Asia/Tokyozdateutil/US/Pacificzdateutil/Asia/Singaporei,  )Úhours)r˜   c             C   s   g | ]}t |ƒ‘qS r   )r4   )ro   Úir   r   r   rp   Q  s    rp   c             C   s   | j S )zD
    Fixture for trying timezones including default (None): {0}
    )r9   )r:   r   r   r   Útz_naive_fixtureT  s    rê   c             C   s   | j S )z4
    Fixture for trying explicit timezones: {0}
    )r9   )r:   r   r   r   Útz_aware_fixture]  s    rë   Úmodule)Úscopec               C   s   t jS )zB
    Yields the UTC timezone object from the datetime module.
    )r   r   r   r   r   r   Údatetime_tz_utcj  s    rî   r   zdateutil/UTCc             C   s   | j S )zQ
    Fixture to provide variants of UTC timezone strings and tzinfo objects.
    )r9   )r:   r   r   r   Úutc_fixturer  s    rï   c             C   s   | j S )zR
    Parametrized fixture for string dtypes.

    * str
    * 'str'
    * 'U'
    )r9   )r:   r   r   r   Ústring_dtype}  s    	rð   c             C   s   | j S )zK
    Parametrized fixture for bytes dtypes.

    * bytes
    * 'bytes'
    )r9   )r:   r   r   r   Úbytes_dtype‰  s    rñ   c             C   s   | j S )zN
    Parametrized fixture for object dtypes.

    * object
    * 'object'
    )r9   )r:   r   r   r   Úobject_dtype”  s    rò   c             C   s   | j S )z\
    Parametrized fixture for datetime64 dtypes.

    * 'datetime64[ns]'
    * 'M8[ns]'
    )r9   )r:   r   r   r   Údatetime64_dtypeŸ  s    ró   c             C   s   | j S )z^
    Parametrized fixture for timedelta64 dtypes.

    * 'timedelta64[ns]'
    * 'm8[ns]'
    )r9   )r:   r   r   r   Útimedelta64_dtypeª  s    rô   c             C   s   | j S )z^
    Parameterized fixture for float dtypes.

    * float
    * 'float32'
    * 'float64'
    )r9   )r:   r   r   r   Úfloat_dtypeµ  s    	rõ   c             C   s   | j S )zg
    Parameterized fixture for complex dtypes.

    * complex
    * 'complex64'
    * 'complex128'
    )r9   )r:   r   r   r   Úcomplex_dtypeÁ  s    	rö   c             C   s   | j S )z|
    Parameterized fixture for signed integer dtypes.

    * int
    * 'int8'
    * 'int16'
    * 'int32'
    * 'int64'
    )r9   )r:   r   r   r   Ú
sint_dtypeÍ  s    r÷   c             C   s   | j S )zx
    Parameterized fixture for unsigned integer dtypes.

    * 'uint8'
    * 'uint16'
    * 'uint32'
    * 'uint64'
    )r9   )r:   r   r   r   Ú
uint_dtypeÛ  s    
rø   c             C   s   | j S )z³
    Parameterized fixture for any integer dtype.

    * int
    * 'int8'
    * 'uint8'
    * 'int16'
    * 'uint16'
    * 'int32'
    * 'uint32'
    * 'int64'
    * 'uint64'
    )r9   )r:   r   r   r   Úany_int_dtypeè  s    rù   c             C   s   | j S )z²
    Parameterized fixture for any nullable integer dtype.

    * 'UInt8'
    * 'Int8'
    * 'UInt16'
    * 'Int16'
    * 'UInt32'
    * 'Int32'
    * 'UInt64'
    * 'Int64'
    )r9   )r:   r   r   r   Úany_nullable_int_dtypeú  s    rú   c             C   s   | j S )z~
    Parameterized fixture for any signed nullable integer dtype.

    * 'Int8'
    * 'Int16'
    * 'Int32'
    * 'Int64'
    )r9   )r:   r   r   r   Úany_signed_nullable_int_dtype  s    
rû   c             C   s   | j S )zí
    Parameterized fixture for any (purely) real numeric dtype.

    * int
    * 'int8'
    * 'uint8'
    * 'int16'
    * 'uint16'
    * 'int32'
    * 'uint32'
    * 'int64'
    * 'uint64'
    * float
    * 'float32'
    * 'float64'
    )r9   )r:   r   r   r   Úany_real_dtype  s    rü   c             C   s   | j S )aÌ  
    Parameterized fixture for all numpy dtypes.

    * bool
    * 'bool'
    * int
    * 'int8'
    * 'uint8'
    * 'int16'
    * 'uint16'
    * 'int32'
    * 'uint32'
    * 'int64'
    * 'uint64'
    * float
    * 'float32'
    * 'float64'
    * complex
    * 'complex64'
    * 'complex128'
    * str
    * 'str'
    * 'U'
    * bytes
    * 'bytes'
    * 'datetime64[ns]'
    * 'M8[ns]'
    * 'timedelta64[ns]'
    * 'm8[ns]'
    * object
    * 'object'
    )r9   )r:   r   r   r   Úany_numpy_dtype-  s    "rý   rŠ   rƒ   ÚcÚbytesó   aó   cr’   zmixed-integerÚmixedg       @Zfloatingg      ð?Úintegerzmixed-integer-floatÚdecimalÚbooleanÚ
datetime64z
2013-01-01z
2018-01-01r‹   r…   Z20180101r   iÝ  iâ  r   r   rŒ   r‘   c             C   s    | j \}}tj|td�}||fS )a�  
    Fixture for all inferred dtypes from _libs.lib.infer_dtype

    The covered (inferred) types are:
    * 'string'
    * 'empty'
    * 'bytes'
    * 'mixed'
    * 'mixed-integer'
    * 'mixed-integer-float'
    * 'floating'
    * 'integer'
    * 'decimal'
    * 'boolean'
    * 'datetime64'
    * 'datetime'
    * 'date'
    * 'timedelta'
    * 'time'
    * 'period'
    * 'interval'

    Returns
    -------
    inferred_dtype : str
        The string for the inferred dtype from _libs.lib.infer_dtype
    values : np.ndarray
        An array of object dtype that will be inferred to have
        `inferred_dtype`

    Examples
    --------
    >>> import pandas._libs.lib as lib
    >>>
    >>> def test_something(any_skipna_inferred_dtype):
    ...     inferred_dtype, values = any_skipna_inferred_dtype
    ...     # will pass
    ...     assert lib.infer_dtype(values, skipna=True) == inferred_dtype
    )r•   )r9   r0   r€   Úobject)r:   Zinferred_dtypeÚvaluesr   r   r   Úany_skipna_inferred_dtypep  s    )
r	  c              C   s    t jddd� ddlm}  | ƒ S )zj
    Get an instance of IPython.InteractiveShell.

    Will raise a skip if IPython is not installed.
    ZIPythonz6.0.0)Z
minversionr   )ÚInteractiveShell)r   ZimportorskipZIPython.core.interactiveshellr
  )r
  r   r   r   Úip£  s    r  ZbsrZcooZcscZcsrZdiaZdokZlilc             C   s   ddl m} t|| jd ƒS )z-
    Yields scipy sparse matrix classes.
    r   )ÚsparseZ_matrix)Zscipyr  Úgetattrr9   )r:   r  r   r   r   Úspmatrix°  s    r  c             C   s   | j S )zœ
    Yields a tuple of a function and its corresponding name. Correspond to
    the list of aggregator "Cython functions" used on selected table items.
    )r9   )r:   r   r   r   Úcython_table_itemsº  s    r  c             C   s.   g | ]&}t ttj|ƒtjjƒrttj|ƒ‘qS r   )Ú
issubclassr  r.   ÚoffsetsZTick)ro   Úor   r   r   rp   Å  s   c             C   s   | j S )zN
    Fixture for Tick based datetime offsets available for a time series.
    )r9   )r:   r   r   r   Útick_classesÃ  s    r  c             C   s   | S )Nr   )r5   r   r   r   r6   Ñ  s    c             C   s   | j S )zk
    Simple fixture for testing keys in sorting methods.
    Tests None (no key) and the identity key.
    )r9   )r:   r   r   r   Úsort_by_keyÑ  s    r  i�ÿÿÿéûÿÿÿièÿÿÿiÔþÿÿéÿÿÿÿ)ÖÚ__doc__Úcollectionsr   r‹   r   r   r   r   r  r   ÚoperatorrÚ   Zdateutil.tzr   r	   Z
hypothesisr
   ÚstZnumpyr0   r   Zpytzr   r   Zpandas.util._test_decoratorsÚutilZ_test_decoratorsÚtdZpandasr.   r   Zpandas._testingZ_testingrq   Zpandas.corer   Zpandas.core.indexes.apir   r   r   r   r"   ÚsettingsZregister_profileZHealthCheckZtoo_slowZload_profileÚsplitr˜   r  Ztseriesr  ÚclsZregister_type_strategyZbuildsZintegersZbooleansZfixturer/   r1   r;   Z
axis_framer<   r=   r>   rA   rD   rE   rJ   rK   rL   rO   rR   rS   ZNaTr�   ZNAÚstrrT   Znulls_fixture2rU   Zunique_nulls_fixture2r–   rW   Zindex_or_series2ra   ri   ru   r‚   r‡   ZmakeUnicodeIndexZmakeStringIndexZmakeDateIndexZmakePeriodIndexZmakeTimedeltaIndexZmakeIntIndexZmakeUIntIndexZmakeRangeIndexZmakeFloatIndexZmakeBoolIndexZmakeCategoricalIndexZmakeIntervalIndexÚfrom_tuplesrH   r“   Úkeysr2   Zindex_fixture2r—   rš   r›   r�   r¢   ÚitemsZ_seriesr¤   Zfloat16Zfloat32Zint8Zint16Zint32Zuint8Zuint16Zuint32Z_narrow_dtypesr¥   r¦   r¨   r©   rª   r¬   r­   r®   Z_all_arithmetic_operatorsr½   ÚaddZraddÚsubZrsubÚmulZrmulÚtruedivZrtruedivÚfloordivZ	rfloordivÚmodZrmodÚpowZrpowr¾   Z_all_numeric_reductionsrÃ   Z_all_boolean_reductionsrÆ   Z_all_reductionsrÇ   rÎ   rÏ   rÖ   r×   rã   ræ   Z	TIMEZONESZTIMEZONE_IDSZparametrize_fixture_docrê   rë   Ztz_aware_fixture2rî   rï   ZSTRING_DTYPESrð   ZBYTES_DTYPESrñ   ZOBJECT_DTYPESrò   ZDATETIME64_DTYPESró   ZTIMEDELTA64_DTYPESrô   ZFLOAT_DTYPESrõ   ZCOMPLEX_DTYPESrö   ZSIGNED_INT_DTYPESr÷   ZUNSIGNED_INT_DTYPESrø   ZALL_INT_DTYPESrù   ZALL_EA_INT_DTYPESrú   ZSIGNED_EA_INT_DTYPESrû   ZALL_REAL_DTYPESrü   ZALL_NUMPY_DTYPESrý   r  Z	TimestampZPeriodZIntervalZ_any_skipna_inferred_dtyper8   Ú_r	  r  r  ÚlistZcython_tabler  Ú__all__r  r  r   r   r   r   Ú<module>   sÖ  
("		*	"


		
! #(	"'  $ $34
	