o
    ҷh+                     @  s  d Z ddlmZ ddlmZ ddlmZ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 ddlmZm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m   m!Z" ddl#m$Z$m%Z% ddl&Z'ddl&m(Z(m)Z)m*Z*m+Z+m,Z,m-Z- ddl.m/Z0 ddl1m2Z2 ddl3m4Z4m5Z5 ddl6m7Z7 erddl8m9Z9m:Z: zddl;Z<W n e=y   dZ>Y nw [<dZ>ddl?Z?ze?@d W n e?jAy   dZ?Y nw dddZBdddZCdd d!ZDejEjFgZGe7ejHe7d"kreGIejEjJ ejKjLd#deMeGd$ ejKNd# d%O D ]ZPeQe'jRjSePZTeUeTejVeTeWd&d'eX d( qd)O D ]"ZPeQe'jRjSePZTeUeTejVeTeWd*d+eX ejWd,d-d.d/ q-d0O D ]"ZPeQe'jRjSePZTeUeTejVeTeWd1d2eX ejWd,d-d.d3 qTejYdd4d5ZZejYdd6dd7d8Z[ejYg d9d:d; d<d=d> Z\e\Z]ejYd,d?gd@d; d<dAdB Z^ejYg dCdDdEdF Z_ejYg dCdDdGdH Z`ejYddgdDdIdJ ZaejYg dKdDdLdM ZbejYg dNdDdOdP ZcejYg dQdDdRdS ZdejYg dQdDdTdU ZeejYddVdWdXdYdZejfd[e"gd\d]gdDd^d_ ZhejYdVdWdXdYdZejfd[e"gd\d]gdDd`da ZiejYddgdDdbdc ZjejYg dddDdedf ZkejYdgdhgdDdidj ZlejYe0jmdkd; d<dldm ZnenZoejYdejpe'jqgdDdndo ZrerZsejYe0jtdpd; d<dqdr ZueuZvejYe(e+gdDdsdt ZwejYe4e+gdudvgd<dwdx ZxexZyejYe4e+e'jzgg dyd<dzd{ Z{ejYe4e+e(e'jzgd|d; d<d}d~ Z|e|Z}ejYdd Z~ejYdd ZejYdd ZejYdddZejYdddZdd Zdd Zi de0dde0dde0jdddde0dde0dde0dde0jdddde0jdddde0jdddde0jdddde0jdddde0jdddde0jdddde0jdddde0jdddde0jdddde0dee4ejdddk e0jdddde0jdddde0de0de4g e5eg dg de e e4g de4eddde4eddde4eddde4ededde4e'jze0ddddZe>re4e'jze0dddZeed< ejYe dDddu ZeZejYdd e D dDdd ZeZejYdd e D dDdd ZejYdddZejYdddZejYdddZddÄ Zddń e D ZejYdddǄZejYdddɄZddń e0jD Zi eeeZejYe dDdd̄ Zddń e0jD Zi eeeeZejYe dDddτ ZejYdddфZejYdddӄZejYdddՄZejYdddׄZejYdddلZejYe)dd+dڍe%ddۃfe)dddڍe%ddۃfe*ddddfe*ddddfe-ddde$dddfe,dddfgdDdd ZejYe0jdDdd ZejYeje2jeje2jeje2jeje2jeje2jeje2jeje2jejejejejejejeje2jeje2jeje2jgdDdd ZejYeje2jeje2jeje2jeje2jeje2jeje2jeje2jgdDdd Zg dZejYedDdd ZddgZejYedDdd Zee ZejYedDdd ZejYejejejejejejgdDdd ZejYg ddDd d ZejYg ddDdd Zg dZejYedDdd ZejYdd	 ZejYdddZejYdddZejYdddZejYdddZdddddddddde e ededede	je	ed,de	edddd gZe?durdee?@de?@dg d!d eD Ze"eeejYeed<d"d# Ze"eed,d ejYed,d ed,d d<d$d% ZeZd&d'ee e	jgZe?dureIe?@d ejYedDd(d) ZeZejYe0jdDd*d+ ZejYdejfde"gd,d]gdDd-d. ZejYd/ejfd,e"gd,d]ejfd0e"gd,d]gdDd1d2 ZejYd3ejfd,e"gd,d]gdDd4d5 ZeZejYe0jdDd6d7 ZejYe0jdDd8d9 ZejYd:dejfde"gd,d]ejfd;e"gd,d]gdDd<d= ZejYe0jdDd>d? ZejYe0jdDd@dA ZejYddCdDZ ejYe0jdDdEdF ZejYe0jdDdGdH ZejYe0jdDdIdJ ZejYe0jdDdKdL ZejYe0j	dDdMdN Z
ejYe0jdDdOdP ZejYe0jdDdQdR ZejYe0jdDdSdT ZejYe0jdDdUdV ZejYe0je0j dDdWdX ZejYe0je0j e0j e0j dDdYdZ ZejYe0jdDd[d\ ZejYe0jdDd]d^ ZejYe0jdDd_d` ZejYe0jdDdadb ZejYe0jdDdcdd Z ddeejpdfgfddee'j!dfgfdgdee'jqdfgfdhdiejpdjgfdkejpejpejpgfdkg fdldeejpdgfdgdeejpdmgfdndoejpdmgfdpd,ejpdgfdqd,ejpdmgfdred,ejpedgfddejpdgfdde'j!dgfdse"dtejpe"dugfde-dvejpe-dwgfdxedyd,d,ejpedzd,d,gfd{d|ejpd}gfded,ejpedgfd~ed,ejpedgfde*dye'jqe*dzgfde)dd,ejpe)ddgfgZ#ee# \Z$Z%ejYe#e$d<dd Z&ejYdd Z'ejYg ddDdd Z(ejYdd e'jSj)D dDdd Z*ejYddd; gdDdd Z+eY dd Z,ejYdddejpejpejpfejpe'jqdfejpe'j!dfe'j!e'j!e'j!fgdDdddZ-ejYe0j.e0j/e0j0gdDdd Z1ejYe0j/e0j0gdDdd Z2ejYe0j.e0j0gdDdd Z3ejYe0j.e0j/gdDdd Z4ejYe0j5e0j/gdDdd Z6ejYe0j7e0j0gdDdd Z8ejYdddZ9ejYdddZ:ddgZ;e?du
re;Ie?@d ejYe;dDdddZ<eY dd Z=dS (  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
    )annotations)abc)datedatetimetime	timedeltatimezone)DecimalN)Path)TYPE_CHECKINGCallable)tzlocaltzutc)
strategies)FixedOffsetutc)DatetimeTZDtypeIntervalDtype)	DataFrameIntervalPeriodSeries	Timedelta	Timestamp)ops)Index
MultiIndex)Version)HashableIteratorFTUTCreturnNonec                 C  s   | j dddd d S )N--no-strict-data-filesstore_falsez6Don't fail if a test is skipped for missing data file.)actionhelp)	addoption)parser r)   B/var/www/html/venv/lib/python3.10/site-packages/pandas/conftest.pypytest_addoptionh   s
   
r+   itempytest.Itempathstrmessagec                 C  s,   | j |r| tjd|  dS dS )a  Ignore doctest warning.

    Parameters
    ----------
    item : pytest.Item
        pytest test item.
    path : str
        Module path to Python object, e.g. "pandas.core.frame.DataFrame.append". A
        warning will be filtered when item.name ends with in given path. So it is
        sufficient to specify e.g. "DataFrame.append".
    message : str
        Message to be filtered.
    zignore:N)nameendswith
add_markerpytestmarkfilterwarnings)r,   r.   r0   r)   r)   r*   ignore_doctest_warningp   s   r7   c                 C  sv   | dp|j ddd}g d}| D ]&}|r,|tjd |D ]
\}}t||| q!d|jv r8|tjj qd S )Nz--doctest-modulesz--doctest-cythonF)default))is_int64_dtypezis_int64_dtype is deprecated)is_interval_dtypezis_interval_dtype is deprecated)is_period_dtypezis_period_dtype is deprecated)is_datetime64tz_dtypez#is_datetime64tz_dtype is deprecated)is_categorical_dtypez"is_categorical_dtype is deprecated)	is_sparsezis_sparse is deprecated)NDFrame.replacezThe 'method' keyword)r?   zSeries.replace without 'value')zSeries.idxminThe behavior of Series.idxmin)zSeries.idxmaxThe behavior of Series.idxmax)zSeriesGroupBy.idxminr@   )zSeriesGroupBy.idxmaxrA   )zmissing.mask_zero_div_zerozdivide by zero encountered)to_pydatetimez>The behavior of DatetimeProperties.to_pydatetime is deprecated)z pandas.core.generic.NDFrame.boolzY(Series|DataFrame).bool is now deprecated and will be removed in future version of pandas)z!pandas.core.generic.NDFrame.firstzqfirst is deprecated and will be removed in a future version. Please create a mask and filter using `.loc` instead)zResampler.fillnaz+DatetimeIndexResampler.fillna is deprecated)DataFrameGroupBy.fillnaz3DataFrameGroupBy.fillna with 'method' is deprecated)rC   z,DataFrame.fillna with 'method' is deprecatedadd_doctest_importsz/frame/)	getoptionr3   r4   r5   usefixturesr7   nodeidarraymanager)itemsconfig
is_doctestignored_doctest_warningsr,   r.   r0   r)   r)   r*   pytest_collection_modifyitems   s   +
rM   z6.83.2ci)deadlinesuppress_health_checkz)MonthBegin MonthEnd BMonthBegin BMonthEndic   )n	normalizez%YearBegin YearEnd BYearBegin BYearEnd         )	min_value	max_value)rR   rS   monthz1QuarterBegin QuarterEnd BQuarterBegin BQuarterEndi   )rR   rS   startingMonthc                 C  s   t | d< t| d< dS )z:
    Make `np` and `pd` names available for doctests.
    nppdN)r]   r^   )doctest_namespacer)   r)   r*   rD      s   rD   )autousec                   C  s   t dd dS )z<
    Configure settings for all tests and test modules.
    chained_assignmentraiseN)r^   
set_optionr)   r)   r)   r*   configure_tests  s   rd   )r   rV   indexcolumnsc                 C     dt |  S Nzaxis=reprxr)   r)   r*   <lambda>      rm   )paramsidsc                 C     | j S )z@
    Fixture for returning the axis numbers of a DataFrame.
    paramrequestr)   r)   r*   axis     rv   rf   c                 C  rg   rh   ri   rk   r)   r)   r*   rm     rn   c                 C  rq   )zA
    Fixture for returning aliases of axis 1 of a DataFrame.
    rr   rt   r)   r)   r*   axis_1  rw   rx   )TFN)ro   c                 C  rq   )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).
    rr   rt   r)   r)   r*   observed      
ry   c                 C  rq   )z6
    Boolean 'ordered' parameter for Categorical.
    rr   rt   r)   r)   r*   ordered-  rw   r{   c                 C  rq   )z%
    Boolean 'skipna' parameter.
    rr   rt   r)   r)   r*   skipna5  rw   r|   )firstlastFc                 C  rq   )z[
    Valid values for the 'keep' parameter used in
    .duplicated or .drop_duplicates
    rr   rt   r)   r)   r*   keep=     r   )bothneitherleftrightc                 C  rq   )zA
    Fixture for trying all interval 'inclusive' parameters.
    rr   rt   r)   r)   r*   inclusive_endpoints_fixtureF  rw   r   )r   r   r   r   c                 C  rq   )z<
    Fixture for trying all interval closed parameters.
    rr   rt   r)   r)   r*   closedN  rw   r   c                 C  rq   )zS
    Secondary closed fixture to allow parametrizing over all pairs of closed.
    rr   rt   r)   r)   r*   other_closedV  rw   r   gzipbz2zipxztarzstd	zstandard)marksc                 C  rq   )zK
    Fixture for trying common compression types in compression tests.
    rr   rt   r)   r)   r*   compression^     r   c                 C  rq   )zk
    Fixture for trying common compression types in compression tests excluding
    uncompressed case.
    rr   rt   r)   r)   r*   compression_onlyp  r   r   c                 C  rq   )z,
    Fixture that an array is writable.
    rr   rt   r)   r)   r*   writable  rw   r   )innerouterr   r   c                 C  rq   )z:
    Fixture for trying all types of join operations.
    rr   rt   r)   r)   r*   	join_type  rw   r   nlargest	nsmallestc                 C  rq   )z1
    Fixture for trying all nselect methods.
    rr   rt   r)   r)   r*   nselect_method  rw   r   c                 C  
   t | jS Ntype__name__rk   r)   r)   r*   rm        
 c                 C  rq   )z/
    Fixture for each null type in pandas.
    rr   rt   r)   r)   r*   nulls_fixture  rw   r   c                 C  rq   )zL
    Fixture for each null type in pandas, each null type exactly once.
    rr   rt   r)   r)   r*   unique_nulls_fixture  rw   r   c                 C  r   r   r   rk   r)   r)   r*   rm     r   c                 C  rq   )z-
    Fixture for each NaT type in numpy.
    rr   rt   r)   r)   r*   np_nat_fixture  rw   r   c                 C  rq   )z;
    Fixture to parametrize over DataFrame and Series.
    rr   rt   r)   r)   r*   frame_or_series  rw   r   re   seriesc                 C  rq   )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
    rr   rt   r)   r)   r*   index_or_series  rz   r   )re   r   arrayc                 C  rq   )zG
    Fixture to parametrize over Index, Series, and ExtensionArray
    rr   rt   r)   r)   r*   index_or_series_or_array  rw   r   c                 C  rq   r   )r   rk   r)   r)   r*   rm         c                 C  rq   )z]
    Fixture to test behavior for Index, Series, DataFrame, and pandas Array
    classes
    rr   rt   r)   r)   r*   box_with_array  r   r   c                  C  s   G dd dt } | S )z,
    Fixture for a dictionary subclass.
    c                   @  s   e Zd ZdddZdS )z"dict_subclass.<locals>.TestSubDictr!   r"   c                 _  s   t j| g|R i | d S r   )dict__init__)selfargskwargsr)   r)   r*   r     s   z+dict_subclass.<locals>.TestSubDict.__init__Nr!   r"   )r   
__module____qualname__r   r)   r)   r)   r*   TestSubDict  s    r   )r   )r   r)   r)   r*   dict_subclass  s   r   c                  C  s   G dd dt j} | S )z8
    Fixture for a non-mapping dictionary subclass.
    c                   @  s2   e Zd ZdddZdd Zddd	ZdddZdS )z5non_dict_mapping_subclass.<locals>.TestNonDictMappingr!   r"   c                 S  s
   || _ d S r   )_data)r   underlying_dictr)   r)   r*   r        
z>non_dict_mapping_subclass.<locals>.TestNonDictMapping.__init__c                 S  s   | j |S r   )r   __getitem__)r   keyr)   r)   r*   r   	  s   zAnon_dict_mapping_subclass.<locals>.TestNonDictMapping.__getitem__r   c                 S  
   | j  S r   )r   __iter__r   r)   r)   r*   r     r   z>non_dict_mapping_subclass.<locals>.TestNonDictMapping.__iter__intc                 S  r   r   )r   __len__r   r)   r)   r*   r     r   z=non_dict_mapping_subclass.<locals>.TestNonDictMapping.__len__Nr   )r!   r   )r!   r   )r   r   r   r   r   r   r   r)   r)   r)   r*   TestNonDictMapping  s
    

r   )r   Mapping)r   r)   r)   r*   non_dict_mapping_subclass  s   r   c                  C  s^   t d} | dd dd dd g }|jdd |jjD |_|jjg d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  rq   r   )yearrk   r)   r)   r*   rm     r   zAmultiindex_year_month_day_dataframe_random_data.<locals>.<lambda>c                 S  rq   r   )rZ   rk   r)   r)   r*   rm     r   c                 S  rq   r   )dayrk   r)   r)   r*   rm     r   c                 S  s   g | ]}| d qS )i8)astype).0levr)   r)   r*   
<listcomp>!  s    zCmultiindex_year_month_day_dataframe_random_data.<locals>.<listcomp>)r   rZ   r   T)inplace)tmmakeTimeDataFramegroupbysumre   
set_levelslevels	set_names)tdfymdr)   r)   r*   /multiindex_year_month_day_dataframe_random_data  s
   
 r   r   c                   C  s*   t g dg dgg dg dgddgdS )z;
    2-level MultiIndex, lexsorted, with string names.
    foobarbazquxonetwothree)
r   r   r   rV   rV      r      r   r   )
r   rV   r   r   rV   rV   r   r   rV   r   r}   second)r   codesnames)r   r)   r)   r)   r*   %lexsorted_two_level_string_multiindex&  s
   r   r   c                 C  s,   | }t tjdd|tg ddddS )z2DataFrame with 2 level MultiIndex with random datar   )
   r   )ABCexpr1   )re   rf   )r   r]   randomdefault_rngstandard_normalr   )r   re   r)   r)   r*    multiindex_dataframe_random_data2  s   r   c                  C  sT   t g d} t ddg}tg d}tg d}ddg}t| |g||g|dd	S )
zJ
    MultiIndex used to test the general functionality of this object
    r   r   r   )r   r   rV   r   r   r   )r   rV   r   rV   r   rV   r}   r   F)r   r   r   verify_integrity)r   r]   r   r   )
major_axis
minor_axismajor_codesminor_codesindex_namesr)   r)   r*   _create_multiindex?  s   r   c                   C  s,   t jddgddgtjddddgg d	d
S )zB
    MultiIndex with a level that is a tzaware DatetimeIndex.
    rV   r   ab20130101r   
US/Eastern)periodstzr   )r   )r   from_productr^   
date_ranger)   r)   r)   r*   _create_mi_with_dt64tz_levelS  s   r   stringr   r   zdatetime-tzz
US/Pacific)r   periodr   rangeint8dtypeint16int32int64uint8uint16uint32uint64float32float64zbool-objectr   r   	complex64
complex128)r   r   r   )rV   r   r   )r   r   rV   rV   r   r   Int64UInt16Float32booleanzstring[python])
bool-dtyper  r  categoricalintervalemptytuplesmi-with-dt64tz-levelmultirepeatsnullable_intnullable_uintnullable_floatnullable_boolzstring-pythonzstring[pyarrow]zstring-pyarrowc                 C  s   t | 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_dictrs   copyrt   r)   r)   r*   re     s   c                 C  s   g | ]\}}t |ts|qS r)   )
isinstancer   r   r   valuer)   r)   r*   r     s
    r   c                 C  s   | j }t|  S )z8
    index fixture, but excluding MultiIndex cases.
    )rs   r  r  )ru   r   r)   r)   r*   
index_flat  s   	r#  c                 C  s0   g | ]\}}| d s|dv st|ts|qS ))r   uintfloat)r   r  r  r  )
startswithr   r   r!  r)   r)   r*   r     s    c                 C  s   t | j jdd}|j }| jdv r4| }d|d dd  |d< d|d dd  |d< t|S d|d< d|d< t||S )	z
    Fixture for indices with missing values.

    Integer-dtype and empty cases are excluded because they cannot hold missing
    values.

    MultiIndex is excluded because isna() is not defined for MultiIndex.
    Tdeep)r  r  r  r   r   rV   N)r  rs   r  valuestolistr   from_tuplesr   )ru   indvalsr)   r)   r*   index_with_missing  s   


r/  r   c                  C     t  } d| _| S )zC
    Fixture for Series of floats with Index of unique strings
    r   )r   makeStringSeriesr1   sr)   r)   r*   string_series     r4  c                  C  r0  )zI
    Fixture for Series of dtype object with Index of unique strings
    objects)r   makeObjectSeriesr1   r2  r)   r)   r*   object_series  r5  r8  c                  C  r0  )z9
    Fixture for Series of floats with DatetimeIndex
    ts)r   makeTimeSeriesr1   r2  r)   r)   r*   datetime_series  r5  r;  c                 C  s*   t | }tjd|}t|| dddS )zHelper for the _series dictr   r   F)re   r1   r  )lenr]   r   r   r   r   )re   sizedatar)   r)   r*   _create_series  s   r?  c                 C  s"   i | ]\}}d | dt |qS )zseries-with-z-indexr?  )r   index_idre   r)   r)   r*   
<dictcomp>  s    rB  c                 C  s   t | S )zE
    Fixture for tests on series with changing types of indices.
    r@  re   r)   r)   r*   series_with_simple_index  s   rD  c                  C  sP   g dg dg} t |  }t|}tjdd}t||d}tj|j	d< |S )z:
    Fixture with a Series with a 2-level MultiIndex.
    )r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r      rC  r   )
r   r   r,  r]   r   r   r   r   naniloc)arraysr  re   r>  serr)   r)   r*   series_with_multilevel_index  s   
rJ  c                 C  s$   i | ]}|j  d tjd|dqS )-seriesr   )r1   r  )r   r   make_rand_seriesr   r  r)   r)   r*   rB    s    c                 C     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
    Tr'  )_index_or_series_objsrs   r  rt   r)   r)   r*   index_or_series_obj  s   rP  c                 C  s   i | ]}|j  d t|qS )rK  )r   r   rM  r)   r)   r*   rB  '  s    c                 C  rN  )z
    Fixture for tests on indexes, series, series with a narrow dtype and
    series with empty objects type
    copy to avoid mutation, e.g. setting .name
    Tr'  )_index_or_series_memory_objsrs   r  rt   r)   r)   r*   index_or_series_memory_obj4  s   rR  c                   C  s   t t 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]
    r  )r   r   getSeriesDatar   r)   r)   r)   r*   	int_frameA  s   rT  c                   C     t t 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   r   getTimeSeriesDatar)   r)   r)   r*   datetime_frame^     rW  c                   C  rU  )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   r   rS  r)   r)   r)   r*   float_frame{  rX  rY  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'].
          ?r   r   r   r
  r  rV   r  )r   r   cr
  r  rC  )r   r]   r   aranger)   r)   r)   r*   mixed_type_frame  s   r]  c                  C  s   t dddt dddt dddt dddt dddt dddt dddt dddt dddt dddg
} ttjdt| | dS )zF
    Fixture for Series with a DatetimeIndex that has duplicates.
    i  rV   r   r      rU   rC  )r   r   r]   r   r   r   r<  )datesr)   r)   r*   (rand_series_with_duplicate_datetimeindex  s   









r`  )r   r   r   g?g      ?z2012-01M)freqz	period[M]z
2012-02-01Dz	period[D]z
2011-01-01r   r3  )unitr   i  )secondsztimedelta64[ns]c                 C  rq   r   rr   rt   r)   r)   r*   ea_scalar_and_dtype     rf  c                 C  rq   )zD
    Fixture for dunder names for common arithmetic operations.
    rr   rt   r)   r)   r*   all_arithmetic_operators  rw   rh  c                 C  rq   )zU
    Fixture for operator and roperator arithmetic, comparison, and logical ops.
    rr   rt   r)   r)   r*   all_binary_operators     "ri  c                 C  rq   )z
    Fixture for operator and roperator arithmetic functions.

    Notes
    -----
    This includes divmod and rdivmod, whereas all_arithmetic_operators
    does not.
    rr   rt   r)   r)   r*   all_arithmetic_functions  s   rk  )countr   maxminmeanprodstdvarmediankurtskewsemc                 C  rq   )z.
    Fixture for numeric reduction names.
    rr   rt   r)   r)   r*   all_numeric_reductions3  rw   rw  allanyc                 C  rq   )z.
    Fixture for boolean reduction names.
    rr   rt   r)   r)   r*   all_boolean_reductions>  rw   rz  c                 C  rq   )z>
    Fixture for all (boolean + numeric) reduction names.
    rr   rt   r)   r)   r*   all_reductionsI  rw   r{  c                 C  rq   )z;
    Fixture for operator module comparison functions.
    rr   rt   r)   r)   r*   comparison_opQ  rg  r|  )__le____lt____ge____gt__c                 C  rq   )zm
    Fixture for dunder names for compare operations except == and !=

    * >=
    * >
    * <
    * <=
    rr   rt   r)   r)   r*   compare_operators_no_eq_neb  rz   r  )__and____rand____or____ror____xor____rxor__c                 C  rq   )zY
    Fixture for dunder names for common logical operations

    * |
    * &
    * ^
    rr   rt   r)   r)   r*   all_logical_operatorso     r  )cumsumcumprodcummincummaxc                 C  rq   )z0
    Fixture for numeric accumulation names
    rr   rt   r)   r)   r*   all_numeric_accumulations  rw   r  c                 C  s
   |  dS )zR
    Returns the configuration for the test setting `--no-strict-data-files`.
    r#   )rE   )pytestconfigr)   r)   r*   strict_data_files  s   
r  r
   c                   C  s   t tjd S )Ntests)r
   __file__parentr)   r)   r)   r*   
tests_path  s   r  c                 C  s   | d d S )Nior>  r)   )r  r)   r)   r*   tests_io_data_path  s   r  Callable[..., str]c                   s(   t jt jtd  fdd}|S )aD  
    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 --no-strict-data-files option is not set.
    r  c                    sJ   t jj g| R  }t j|s#rtd| dtd| d |S )NzCould not find file z' and --no-strict-data-files is not set.zCould not find .)osr.   joinexists
ValueErrorr4   skip)r   r.   	BASE_PATHr  r)   r*   deco  s   
zdatapath.<locals>.deco)r  r.   r  dirnamer  )r  r  r)   r  r*   datapath  s   
r  c                 C  s   t | ddddS )z*
    The iris dataset as a DataFrame.
    r  r>  csvziris.csv)r^   read_csv)r  r)   r)   r*   iris  s   r  z
Asia/Tokyozdateutil/US/Pacificzdateutil/Asia/Singaporez+01:15z-02:15z	UTC+01:15z	UTC-02:15i,  i)hoursr)  r   r   c                 C  s   g | ]}t |qS r)   ri   )r   ir)   r)   r*   r     s    c                 C  rq   )zD
    Fixture for trying timezones including default (None): {0}
    rr   rt   r)   r)   r*   tz_naive_fixture  r   r  c                 C  rq   )z4
    Fixture for trying explicit timezones: {0}
    rr   rt   r)   r)   r*   tz_aware_fixture  r   r  r   zdateutil/UTCc                 C  rq   )zQ
    Fixture to provide variants of UTC timezone strings and tzinfo objects.
    rr   rt   r)   r)   r*   utc_fixture  rw   r  c                 C  rq   )zR
    Parametrized fixture for string dtypes.

    * str
    * 'str'
    * 'U'
    rr   rt   r)   r)   r*   string_dtype     	r  pyarrowc                 C  rq   )za
    Parametrized fixture for string dtypes.

    * 'string[python]'
    * 'string[pyarrow]'
    rr   rt   r)   r)   r*   nullable_string_dtype     r  pythonpyarrow_numpyc                 C  rq   )zx
    Parametrized fixture for pd.options.mode.string_storage.

    * 'python'
    * 'pyarrow'
    * 'pyarrow_numpy'
    rr   rt   r)   r)   r*   string_storage-  r   r  numpy_nullablec                 C  rq   )zb
    Parametrized fixture for pd.options.mode.string_storage.

    * 'python'
    * 'pyarrow'
    rr   rt   r)   r)   r*   dtype_backend?  r  r  c                 C  rq   )zK
    Parametrized fixture for bytes dtypes.

    * bytes
    * 'bytes'
    rr   rt   r)   r)   r*   bytes_dtypeS     r  c                 C  rq   )zN
    Parametrized fixture for object dtypes.

    * object
    * 'object'
    rr   rt   r)   r)   r*   object_dtype^  r  r  objectzstring[pyarrow_numpy]c                 C  rq   )zo
    Parametrized fixture for string dtypes.
    * 'object'
    * 'string[python]'
    * 'string[pyarrow]'
    rr   rt   r)   r)   r*   any_string_dtypei  r   r  c                 C  rq   )z\
    Parametrized fixture for datetime64 dtypes.

    * 'datetime64[ns]'
    * 'M8[ns]'
    rr   rt   r)   r)   r*   datetime64_dtype{  r  r  c                 C  rq   )z^
    Parametrized fixture for timedelta64 dtypes.

    * 'timedelta64[ns]'
    * 'm8[ns]'
    rr   rt   r)   r)   r*   timedelta64_dtype  r  r  r   c                	   C  s   t ddddddddS )z-
    Fixture emits fixed Timestamp.now()
    i  rV   rW   r^        )r   rZ   r   hourminuter   microsecond)r   r)   r)   r)   r*   fixed_now_ts  s   r  c                 C  rq   )z^
    Parameterized fixture for float dtypes.

    * float
    * 'float32'
    * 'float64'
    rr   rt   r)   r)   r*   float_numpy_dtype  r  r  c                 C  rq   )zR
    Parameterized fixture for float dtypes.

    * 'Float32'
    * 'Float64'
    rr   rt   r)   r)   r*   float_ea_dtype  r  r  c                 C  rq   )z~
    Parameterized fixture for float dtypes.

    * float
    * 'float32'
    * 'float64'
    * 'Float32'
    * 'Float64'
    rr   rt   r)   r)   r*   any_float_dtype  r  r  c                 C  rq   )zg
    Parameterized fixture for complex dtypes.

    * complex
    * 'complex64'
    * 'complex128'
    rr   rt   r)   r)   r*   complex_dtype  r  r  c                 C  rq   )z|
    Parameterized fixture for signed integer dtypes.

    * int
    * 'int8'
    * 'int16'
    * 'int32'
    * 'int64'
    rr   rt   r)   r)   r*   any_signed_int_numpy_dtype  r  r  c                 C  rq   )zx
    Parameterized fixture for unsigned integer dtypes.

    * 'uint8'
    * 'uint16'
    * 'uint32'
    * 'uint64'
    rr   rt   r)   r)   r*   any_unsigned_int_numpy_dtype  rz   r  c                 C  rq   )z
    Parameterized fixture for any integer dtype.

    * int
    * 'int8'
    * 'uint8'
    * 'int16'
    * 'uint16'
    * 'int32'
    * 'uint32'
    * 'int64'
    * 'uint64'
    rr   rt   r)   r)   r*   any_int_numpy_dtype  r   r  c                 C  rq   )z
    Parameterized fixture for any nullable integer dtype.

    * 'UInt8'
    * 'Int8'
    * 'UInt16'
    * 'Int16'
    * 'UInt32'
    * 'Int32'
    * 'UInt64'
    * 'Int64'
    rr   rt   r)   r)   r*   any_int_ea_dtype  rg  r  c                 C  rq   )a.  
    Parameterized fixture for any nullable integer dtype.

    * int
    * 'int8'
    * 'uint8'
    * 'int16'
    * 'uint16'
    * 'int32'
    * 'uint32'
    * 'int64'
    * 'uint64'
    * 'UInt8'
    * 'Int8'
    * 'UInt16'
    * 'Int16'
    * 'UInt32'
    * 'Int32'
    * 'UInt64'
    * 'Int64'
    rr   rt   r)   r)   r*   any_int_dtype
  s   r  c                 C  rq   )z
    Parameterized fixture for any nullable integer dtype and
    any float ea dtypes.

    * 'UInt8'
    * 'Int8'
    * 'UInt16'
    * 'Int16'
    * 'UInt32'
    * 'Int32'
    * 'UInt64'
    * 'Int64'
    * 'Float32'
    * 'Float64'
    rr   rt   r)   r)   r*   any_numeric_ea_dtype$  s   r  c                 C  rq   )a  
    Parameterized fixture for any nullable integer dtype and
    any float ea dtypes.

    * 'UInt8'
    * 'Int8'
    * 'UInt16'
    * 'Int16'
    * 'UInt32'
    * 'Int32'
    * 'UInt64'
    * 'Int64'
    * 'Float32'
    * 'Float64'
    * 'uint8[pyarrow]'
    * 'int8[pyarrow]'
    * 'uint16[pyarrow]'
    * 'int16[pyarrow]'
    * 'uint32[pyarrow]'
    * 'int32[pyarrow]'
    * 'uint64[pyarrow]'
    * 'int64[pyarrow]'
    * 'float32[pyarrow]'
    * 'float64[pyarrow]'
    rr   rt   r)   r)   r*   any_numeric_ea_and_arrow_dtype:  s    r  c                 C  rq   )z~
    Parameterized fixture for any signed nullable integer dtype.

    * 'Int8'
    * 'Int16'
    * 'Int32'
    * 'Int64'
    rr   rt   r)   r)   r*   any_signed_int_ea_dtype]  rz   r  c                 C  rq   )z
    Parameterized fixture for any (purely) real numeric dtype.

    * int
    * 'int8'
    * 'uint8'
    * 'int16'
    * 'uint16'
    * 'int32'
    * 'uint32'
    * 'int64'
    * 'uint64'
    * float
    * 'float32'
    * 'float64'
    rr   rt   r)   r)   r*   any_real_numpy_dtypej  s   r  c                 C  rq   )a  
    Parameterized fixture for any (purely) real numeric dtype.

    * int
    * 'int8'
    * 'uint8'
    * 'int16'
    * 'uint16'
    * 'int32'
    * 'uint32'
    * 'int64'
    * 'uint64'
    * float
    * 'float32'
    * 'float64'

    and associated ea dtypes.
    rr   rt   r)   r)   r*   any_real_numeric_dtype  s   r  c                 C  rq   )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'
    rr   rt   r)   r)   r*   any_numpy_dtype  rj  r  c                 C  rq   )a  
    Parameterized fixture for all numeric dtypes.

    * int
    * 'int8'
    * 'uint8'
    * 'int16'
    * 'uint16'
    * 'int32'
    * 'uint32'
    * 'int64'
    * 'uint64'
    * float
    * 'float32'
    * 'float64'
    * complex
    * 'complex64'
    * 'complex128'
    * 'UInt8'
    * 'Int8'
    * 'UInt16'
    * 'Int16'
    * 'UInt32'
    * 'Int32'
    * 'UInt64'
    * 'Int64'
    * 'Float32'
    * 'Float64'
    rr   rt   r)   r)   r*   any_numeric_dtype  s   r  r   r[  mixedbytes   a   cr  zmixed-integerg       @floatingrZ  integerzmixed-integer-floatdecimal
datetime64z
2013-01-01z
2018-01-01r   20180101r   i  i  complexy      ?      ?y       @       @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
    --------
    >>> from pandas._libs import 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  )rs   r]   r   r  )ru   inferred_dtyper*  r)   r)   r*   any_skipna_inferred_dtype  s   
)r  c                  C  s>   t jddd ddlm}  ddlm} | }d|j_| |dS )	zj
    Get an instance of IPython.InteractiveShell.

    Will raise a skip if IPython is not installed.
    IPythonz6.0.0)
minversionr   )InteractiveShell)Configz:memory:)rJ   )r4   importorskipIPython.core.interactiveshellr  traitlets.configr  HistoryManager	hist_file)r  r  r[  r)   r)   r*   ip/  s   
r  )bsrcoocsccsrdiadoklilc                 C  s   t d}t|| jd S )z-
    Yields scipy sparse matrix classes.
    zscipy.sparse_matrix)r4   r  getattrrs   )ru   sparser)   r)   r*   spmatrixB  s   
r  c                 C  s6   g | ]}t ttj|tjjr|d krttj|qS )Tick)
issubclassr  r^   offsetsr  )r   or)   r)   r*   r   M  s    
c                 C  rq   )zN
    Fixture for Tick based datetime offsets available for a time series.
    rr   rt   r)   r)   r*   tick_classesL  r  r  c                 C  s   | S r   r)   rk   r)   r)   r*   rm   Z  s    c                 C  rq   )zk
    Simple fixture for testing keys in sorting methods.
    Tests None (no key) and the identity key.
    rr   rt   r)   r)   r*   sort_by_keyZ  r   r  c                  c  sz    t d ddlm}  ddlm} ddlm} G dd d|}| d|d	d
 | V  |dd  d |j	d< |j
  d S )Nfsspecr   )register_implementation)MemoryFileSystem)	_registryc                      s(   e Zd ZdZdgZd fddZ  ZS )z fsspectest.<locals>.TestMemoryFStestmemNr!   r"   c                   s(   | dd | jd< t jdi | d S )Ntestr   r)   )popr  superr   )r   r   	__class__r)   r*   r   n  s   z)fsspectest.<locals>.TestMemoryFS.__init__r   )r   r   r   protocolr  r   __classcell__r)   r)   r  r*   TestMemoryFSj  s    r  r  T)clobber)r4   r  r  r  fsspec.implementations.memoryr  fsspec.registryr  r  r  storeclear)r  r  registryr  r)   r)   r*   
fsspectestc  s   

r  )r   NN)EgonVenkmanN)NCC1701Dr  r  #tuple[Hashable, Hashable, Hashable]c                 C  rq   )zP
    A 3-tuple of names, the first two for operands, the last for a result.
    rr   rt   r)   r)   r*   r   y  s   r   c                 C  rq   )zI
    Parametrize over __setitem__, loc.__setitem__, iloc.__setitem__
    rr   rt   r)   r)   r*   indexer_sli  rw   r  c                 C  rq   )z<
    Parametrize over loc.__getitem__, iloc.__getitem__
    rr   rt   r)   r)   r*   
indexer_li  rw   r  c                 C  rq   )z8
    Parametrize over __setitem__, iloc.__setitem__
    rr   rt   r)   r)   r*   
indexer_si  rw   r  c                 C  rq   )z7
    Parametrize over __setitem__, loc.__setitem__
    rr   rt   r)   r)   r*   
indexer_sl  rw   r  c                 C  rq   )z:
    Parametrize over at.__setitem__, loc.__setitem__
    rr   rt   r)   r)   r*   
indexer_al  rw   r  c                 C  rq   )z<
    Parametrize over iat.__setitem__, iloc.__setitem__
    rr   rt   r)   r)   r*   indexer_ial  rw   r  boolc                   C  s   t jjjdkS )z>
    Fixture to check if the array manager is being used.
    r   )r^   optionsmodedata_managerr)   r)   r)   r*   using_array_manager  s   r  c                   C  s   t jjjot jjjdkS )z7
    Fixture to check if Copy-on-Write is enabled.
    block)r^   r  r  copy_on_writer  r)   r)   r)   r*   using_copy_on_write  s   r  zEurope/Warsawzdateutil/Europe/Warsawc                 C  rq   )zE
    tzinfo for Europe/Warsaw using pytz, dateutil, or zoneinfo.
    rr   rt   r)   r)   r*   warsaw  rw   r  c                   C  s   dS )N)r  r  r)   r)   r)   r)   r*   arrow_string_storage  s   r   r   )r,   r-   r.   r/   r0   r/   r!   r"   )r!   r   )r!   r   )r!   r   )r!   r
   )r  r/   r!   r  )r!   r   )r!   r  )r!   r  )r!   r/   (>  __doc__
__future__r   collectionsr   r   r   r   r   r   r  r	   operatorr  pathlibr
   typingr   r   dateutil.tzr   r   
hypothesisr   stnumpyr]   r4   pytzr   r   pandas.util._test_decoratorsutil_test_decoratorstdpandas.core.dtypes.dtypesr   r   pandasr^   r   r   r   r   r   r   pandas._testing_testingr   pandas.corer   pandas.core.indexes.apir   r   pandas.util.versionr   collections.abcr   r   r  paImportErrorhas_pyarrowzoneinfoZoneInfoZoneInfoNotFoundErrorr+   r7   rM   HealthChecktoo_slowhypothesis_health_checks__version__appenddiffering_executorssettingsregister_profiletupleload_profilesplitr1   r  tseriesr  clsregister_type_strategybuildsintegersbooleansfixturerD   rd   rv   
axis_framerx   ry   r{   r|   r   r   r   r   rs   
skip_if_nor   r   r   r   r   NULL_OBJECTSr   nulls_fixture2rF  NaTr   unique_nulls_fixture2NP_NAT_OBJECTSr   np_nat_fixture2r   r   index_or_series2r   r   r   box_with_array2r   r   r   r   r   r   r   makeStringIndexmakeDateIndexmakePeriodIndexmakeTimedeltaIndexmakeRangeIndexmakeIntIndexmakeUIntIndexmakeFloatIndexmakeBoolIndexr   r  r   r   r   makeNumericIndexmakeCategoricalIndexmakeIntervalIndexr,  r   r\  r  r  idxkeysre   index_fixture2rI   r#  index_flat2r/  r4  r8  r;  r?  _seriesrD  rJ  NARROW_NP_DTYPES_narrow_seriesrO  rP  PYTHON_DATA_TYPES_typ_objects_seriesrQ  rR  rT  rW  rY  r]  r`  rf  arithmetic_dunder_methodsrh  addraddsubrsubmulrmultruedivrtruedivfloordiv	rfloordivmodrmodpowrpoweqneltlegtgeand_rand_xorrxoror_ror_ri  rk  _all_numeric_reductionsrw  _all_boolean_reductionsrz  _all_reductionsr{  r|  r  r  _all_numeric_accumulationsr  r  r  r  r  r  	TIMEZONESextendTIMEZONE_IDSparametrize_fixture_docr/   r  r  tz_aware_fixture2_UTCSr  utc_fixture2STRING_DTYPESr  r  r  r  string_storage2BYTES_DTYPESr  OBJECT_DTYPESr  r  DATETIME64_DTYPESr  TIMEDELTA64_DTYPESr  r  FLOAT_NUMPY_DTYPESr  FLOAT_EA_DTYPESr  ALL_FLOAT_DTYPESr  COMPLEX_DTYPESr  SIGNED_INT_NUMPY_DTYPESr  UNSIGNED_INT_NUMPY_DTYPESr  ALL_INT_NUMPY_DTYPESr  ALL_INT_EA_DTYPESr  ALL_INT_DTYPESr  r  ALL_INT_PYARROW_DTYPES_STR_REPRFLOAT_PYARROW_DTYPES_STR_REPRr  SIGNED_INT_EA_DTYPESr  ALL_REAL_NUMPY_DTYPESr  ALL_REAL_DTYPESr  ALL_NUMPY_DTYPESr  ALL_NUMERIC_DTYPESr  NAr  _any_skipna_inferred_dtyperp   _r  r  r  __all__r  r  r  r   setitemlocrG  r  r  r  r  atr  iatr  r  r  warsawsr  r   r)   r)   r)   r*   <module>   sj    

@



































	

"

	
			




	













!








	
$#$$2	
