o
    i&                     @   s4  d 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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*Z+ ddl,m-Z- ddl.m/Z/m0Z0 zddl1Z2W n e3y   dZ4Y nw [2dZ4dZ5e"j6j7rddl5Z5ze58d W n e5j9y   dZ5Y nw ej:;dZ<dddZ=dej>de?de?ddfddZ@dd ZAejBjCddejDjEfd ejBFd dG D ]ZHeIe"jJjKeHZLeMeLejNeLeOdd eP d! qd"G D ]"ZHeIe"jJjKeHZLeMeLejNeLeOd#d$eP ejOd%d&d'd( qd)G D ]"ZHeIe"jJjKeHZLeMeLejNeLeOd*d+eP ejOd%d&d'd, q3ejQdd-d.ZRejQdd/dd0d1ZSejQg d2d3d4 d5d6d7 ZTeTZUejQd%d8gd9d4 d5d:d; ZVejQg d<d=d>d? ZWejQg d<d=d@dA ZXejQg dBd=dCdD ZYejQg dEd=dFdG ZZejQg dHd=dIdJ Z[ejQg dHd=dKdL Z\ejQddMdNdOdPdQej]dRe^dSdTgd=dUdV Z_ejQdMdNdOdPdQej]dRe^dSdTgd=dWdX Z`ejQddgd=dYdZ ZaejQg d[d=d\d] ZbejQd^d_gd=d`da ZcejQe+jddbd4 d5dcdd ZeeeZfejQdejge"jhgd=dedf ZieiZjejQe+jkdgd4 d5dhdi ZlelZmejQe#e&gd=djdk ZnejQe/e&gdldmgd5dndo ZoeoZpejQe/e&e"jqgg dpd5dqdr ZrejQe/e&e#e"jqgdsd4 d5dtdu ZsesZtejQdvdw ZuejQdxdy ZvejQdzd{ ZwejQde0fd|d}ZxejQde#fd~dZydd Zzdd Z{i de+|dde+}dde+j}dddde+~dde+dde+dde+dde+dde+dde+ddde+ddde+jdddde+jdddde+jdddde+jdddde+jdddde+jdddi de+jdddde+jdddde+jdddde+jdddde+dede/ejddk de+dde+dde/g de0eg dg dde{ dez de/g dde/edddde/edddde/edddde/ededdde/e"jqe+|dddiZe4re/e"jqe+|dddZeed< ejQe d=ddl ZeZejQdd eD d=ddĄ ZeZejQdd eD d=ddǄ ZejQde&fddɄZejQde&fdd˄ZejQde&fdd̈́Zddτ Zddф e D ZejQde&fddӄZejQde&fddՄZddф e+jD Zi eeeZejQe d=dd؄ ZejQde#fddڄZejQde#fdd܄ZejQde#fddބZejQde#fddZejQde&fddZejQe$dd$de ddfe$ddde ddfe%ddddfe%ddddfe(dddeddfe'dddfgd=dd Zg dZejQed=dd ZejQe
je-je
je-je
je-je
je-je
je-je
je-je
je-je
je
je
je
je
je
je
je-je
je-je
je-jgd=dd ZejQe
je-je
je-je
je-je
je-je
je-je
je-je
je-jgd=dd Zg dZejQed=dd Zdd gZejQed=dd Zee ZejQed=dd ZejQe
je
je
je
je
je
jgd=dd ZejQg dd=dd	 ZejQg d
d=dd ZejQdd ZejQde?dede?f fddZejQde#f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Ze5dur7eԠe58de58dg d!d eD Zee?eփejQeed5d"d# Zee?ed%d ejQed%d ed%d d5d$d% ZeZڐd&d'ee ejgZe5dure۠e58d ejQed=d(d) ZeZejQe+jd=d*d+ ZejQdej]dej^d,d-d.dTgd=d/d0 ZejQd1ej]d,ej^d,d-d.dTgd=d2d3 ZeZejQe+jd=d4d5 ZejQe+jd=d6d7 ZejQd8dej]dej^d,d-d.dTgd=d9d: ZejQe+jd=d;d< ZejQe+jd=d=d> ZejQde(fd?d@ZejQe+jd=dAdB ZejQe+jd=dCdD ZejQe+je+j d=dEdF ZejQe+jd=dGdH ZejQe+jd=dIdJ ZejQe+jd=dKdL ZejQe+jd=dMdN ZejQe+jd=dOdP ZejQe+je+j d=dQdR ZejQe+je+j d=dSdT ZejQe+jd=dUdV Z ejQe+jd=dWdX ZejQe+jd=dYdZ ZejQe+je+j e+j e+j d=d[d\ Zdd]ejgd^gfdd]e"jd^gfd_d]e"jhd^gfd`daejgdbgfdejgejgejggfdg fdcd]ejgddgfd_d]ejgdegfdfdgejgdegfdhd%ejgddgfdid%ejgdegfdje	d%ejge	ddgfddejgdgfdde"jdgfdkedlejgedmgfde(dnejge(dogfdpedqd%d%ejgedrd%d%gfded%ejgeddgfdsed%ejgeddgfde%dqe"jhe%drgfde$dd%ejge$dddgfgZee \Z	Z
ejQee	d5dtdu ZejQdvdw ZejQg dxd=dydz ZejQd{d e"jKjD d=d|d} ZejQdd~d4 gd=dd ZeQ dd ZejQdddejgejgejgfejge"jhdfejge"jdfe"je"je"jfgd=dd ZejQe+je+je+jgd=dd ZejQe+je+jgd=dd ZejQe+je+jgd=dd ZejQe+je+jgd=dd ZejQe+je+jgd=dd ZejQe+je+jgd=dd ZejQdd ZejQdef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
    )abc)datedatetimetime	timedeltatimezone)DecimalN)Callable)tzlocaltzutc)
strategies)FixedOffsetutc)DatetimeTZDtypeIntervalDtype)	DataFrameIntervalPeriodSeries	Timedelta	Timestamp)ops)Index
MultiIndexFTUTCz3ignore:Promotion of numbers and bools:FutureWarningreturnc                 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 )N--skip-slow
store_truezskip slow tests)actionhelp--skip-networkzskip network tests	--skip-dbzskip db testsz--run-high-memoryzrun high memory tests--only-slowzrun only slow tests--strict-data-filesz0Fail if a test is skipped for missing data file.)	addoption)parser r&   J/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/pandas/conftest.pypytest_addoptionf   s   
r(   itempath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*   r+   r&   r&   r'   ignore_doctest_warningu   s   r2   c                 C   s8  | d}| d}| d}| d}tjjd|dftjjd|dftjjd|dfg}g d	}| D ]h}| d
s?|j dddrU|tjd |D ]
\}	}
t||	|
 qJd|j	v ra|tjj
 |t |D ] \}}}}||jv r|r|tjd|   n|| qh|rd|jvr|tjd q1d S )Nr   r"   r    r!   slownetworkz	--networkdb)	)zDataFrame.appendz%The frame.append method is deprecated)zSeries.appendz&The series.append method is deprecated)zdtypes.common.is_categoricalzis_categorical is deprecated)zCategorical.replacez!Categorical.replace is deprecated)zdtypes.common.is_extension_typez!'is_extension_type' is deprecated)zIndex.is_mixedzIndex.is_mixed is deprecated)zMultiIndex._is_lexsortedz%MultiIndex.is_lexsorted is deprecated)zmissing.mask_zero_div_zerozdivide by zero encountered)z$_validators.validate_axis_style_argszUse named argumentsz--doctest-modulesz--doctest-cythonF)defaultadd_doctest_importsz/frame/zskipping due to zskipping due to --only-slow)	getoptionr/   r0   r3   r4   r5   r.   usefixturesr2   nodeidarraymanager suppress_npdev_promotion_warningkeywordsskip)itemsconfig	skip_slow	only_slowskip_networkskip_dbmarksignored_doctest_warningsr)   r*   r+   r0   kwdskip_if_foundarg_namer&   r&   r'   pytest_collection_modifyitems   s<   







rJ   ci)deadlinesuppress_health_checkz)MonthBegin MonthEnd BMonthBegin BMonthEndic   )n	normalizez%YearBegin YearEnd BYearBegin BYearEnd         )	min_value	max_value)rO   rP   monthz1QuarterBegin QuarterEnd BQuarterBegin BQuarterEndi   )rO   rP   startingMonthc                 C   s   t | d< t| d< dS )z:
    Make `np` and `pd` names available for doctests.
    nppdN)rZ   r[   )doctest_namespacer&   r&   r'   r7      s   r7   )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   ra   )r   rS   indexcolumnsc                 C      dt |  S Nzaxis=reprxr&   r&   r'   <lambda>	      rj   )paramsidsc                 C      | j S )z@
    Fixture for returning the axis numbers of a DataFrame.
    paramrequestr&   r&   r'   axis	     rs   rc   c                 C   rd   re   rf   rh   r&   r&   r'   rj     rk   c                 C   rn   )zA
    Fixture for returning aliases of axis 1 of a DataFrame.
    ro   rq   r&   r&   r'   axis_1  rt   ru   )TFN)rl   c                 C   rn   )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).
    ro   rq   r&   r&   r'   observed     
rv   c                 C   rn   )z6
    Boolean 'ordered' parameter for Categorical.
    ro   rq   r&   r&   r'   ordered)  rt   rx   )firstlastFc                 C   rn   )z[
    Valid values for the 'keep' parameter used in
    .duplicated or .drop_duplicates
    ro   rq   r&   r&   r'   keep1     r{   )bothneitherleftrightc                 C   rn   )zA
    Fixture for trying all interval 'inclusive' parameters.
    ro   rq   r&   r&   r'   inclusive_endpoints_fixture:  rt   r   )r   r   r}   r~   c                 C   rn   )z<
    Fixture for trying all interval closed parameters.
    ro   rq   r&   r&   r'   closedB  rt   r   c                 C   rn   )zS
    Secondary closed fixture to allow parametrizing over all pairs of closed.
    ro   rq   r&   r&   r'   other_closedJ  rt   r   gzipbz2zipxztarzstd	zstandard)rE   c                 C   rn   )zK
    Fixture for trying common compression types in compression tests.
    ro   rq   r&   r&   r'   compressionR     r   c                 C   rn   )zk
    Fixture for trying common compression types in compression tests excluding
    uncompressed case.
    ro   rq   r&   r&   r'   compression_onlyd  r   r   c                 C   rn   )z,
    Fixture that an array is writable.
    ro   rq   r&   r&   r'   writablev  rt   r   )innerouterr   r   c                 C   rn   )z:
    Fixture for trying all types of join operations.
    ro   rq   r&   r&   r'   	join_type~  rt   r   nlargest	nsmallestc                 C   rn   )z1
    Fixture for trying all nselect methods.
    ro   rq   r&   r&   r'   nselect_method  rt   r   c                 C   
   t | jS Ntype__name__rh   r&   r&   r'   rj        
 c                 C   rn   )z/
    Fixture for each null type in pandas.
    ro   rq   r&   r&   r'   nulls_fixture  rt   r   c                 C   rn   )zL
    Fixture for each null type in pandas, each null type exactly once.
    ro   rq   r&   r&   r'   unique_nulls_fixture  rt   r   c                 C   r   r   r   rh   r&   r&   r'   rj     r   c                 C   rn   )z-
    Fixture for each NaT type in numpy.
    ro   rq   r&   r&   r'   np_nat_fixture  rt   r   c                 C   rn   )z;
    Fixture to parametrize over DataFrame and Series.
    ro   rq   r&   r&   r'   frame_or_series  rt   r   rb   seriesc                 C   rn   )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
    ro   rq   r&   r&   r'   index_or_series  s   r   )rb   r   arrayc                 C   rn   )zG
    Fixture to parametrize over Index, Series, and ExtensionArray
    ro   rq   r&   r&   r'   index_or_series_or_array  rt   r   c                 C   rn   r   )r   rh   r&   r&   r'   rj         c                 C   rn   )z]
    Fixture to test behavior for Index, Series, DataFrame, and pandas Array
    classes
    ro   rq   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   Nc                 _   s   t j| g|R i | d S r   )dict__init__)selfargskwargsr&   r&   r'   r     s   z+dict_subclass.<locals>.TestSubDict.__init__r   N)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                   @   s.   e Zd ZdddZdd Zdd Zd	d
 ZdS )z5non_dict_mapping_subclass.<locals>.TestNonDictMappingr   Nc                 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__c                 S   
   | j  S r   )r   __iter__r   r&   r&   r'   r     r   z>non_dict_mapping_subclass.<locals>.TestNonDictMapping.__iter__c                 S   r   r   )r   __len__r   r&   r&   r'   r     r   z=non_dict_mapping_subclass.<locals>.TestNonDictMapping.__len__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   rn   r   )yearrh   r&   r&   r'   rj     r   zAmultiindex_year_month_day_dataframe_random_data.<locals>.<lambda>c                 S   rn   r   )rW   rh   r&   r&   r'   rj     r   c                 S   rn   r   )dayrh   r&   r&   r'   rj     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   rW   r   T)inplace)tmmakeTimeDataFramegroupbysumrb   
set_levelslevels	set_names)tdfymdr&   r&   r'   /multiindex_year_month_day_dataframe_random_data  s
   
 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   rS   rS      r      r   r   )
r   rS   r   r   rS   rS   r   r   rS   r   ry   second)r   codesnames)r   r&   r&   r&   r'   %lexsorted_two_level_string_multiindex  s
   r   c                 C   s(   | }t tjdd|tg ddddS )z2DataFrame with 2 level MultiIndex with random data
   r   )ABCexpr,   )rb   rc   )r   rZ   randomrandnr   )r   rb   r&   r&   r'    multiindex_dataframe_random_data)  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   rS   r   r   r   )r   rS   r   rS   r   rS   ry   r   F)r   r   r   verify_integrity)r   rZ   r   r   )
major_axis
minor_axismajor_codesminor_codesindex_namesr&   r&   r'   _create_multiindex4  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.
    rS   r   ab20130101r   
US/Eastern)periodstzr   )r   )r   from_productr[   
date_ranger&   r&   r&   r'   _create_mi_with_dt64tz_levelH  s   r   stringr   r   zdatetime-tzz
US/Pacific)r   periodr   intuintrangefloat	complex64
complex128	num_int64int64dtype	num_int32int32	num_int16int16num_int8int8
num_uint64uint64
num_uint32uint32
num_uint16uint16	num_uint8uint8num_float64float64num_float32float32zbool-objectr   
bool-dtypecategoricalintervalemptytuples)r   r   r   )rS   r   r   mi-with-dt64tz-levelmultirepeats)r   r   rS   rS   r   r   nullable_intInt64nullable_uintUInt16nullable_floatFloat32nullable_boolbooleanzstring-pythonzstring[python]z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_dictrp   copyrq   r&   r&   r'   rb   }  s   c                 C   s   g | ]}t t| ts|qS r&   )
isinstancer$  r   r   r   r&   r&   r'   r     s
    r   c                 C   s   | j }t|  S )z8
    index fixture, but excluding MultiIndex cases.
    )rp   r$  r%  )rr   r   r&   r&   r'   
index_flat  s   	r(  c                 C   s0   g | ]}|d v s| dstt| ts|qS ))r   r   r   r  r  r  num_)
startswithr&  r$  r   r'  r&   r&   r'   r     s    c                 C   s   t | j jdd}|j}| jdv r2| }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   rS   N)r$  rp   r%  valuestolistr   from_tuplesr   )rr   indvalsr&   r&   r'   index_with_missing  s   

r3  c                  C      t  } d| _| S )zC
    Fixture for Series of floats with Index of unique strings
    r   )r   makeStringSeriesr,   sr&   r&   r'   string_series     r8  c                  C   r4  )zI
    Fixture for Series of dtype object with Index of unique strings
    objects)r   makeObjectSeriesr,   r6  r&   r&   r'   object_series  r9  r<  c                  C   r4  )z9
    Fixture for Series of floats with DatetimeIndex
    ts)r   makeTimeSeriesr,   r6  r&   r&   r'   datetime_series  r9  r?  c                 C   s"   t | }tj|}t|| ddS )zHelper for the _series dictr   )rb   r,   )lenrZ   r   r   r   )rb   sizedatar&   r&   r'   _create_series  s   rC  c                 C   s"   i | ]\}}d | dt |qS )zseries-with-z-indexrC  )r   index_idrb   r&   r&   r'   
<dictcomp>  s    rF  c                 C   s   t | S )zE
    Fixture for tests on series with changing types of indices.
    rD  rb   r&   r&   r'   series_with_simple_index  s   rH  c                  C   sH   g dg dg} t |  }t|}tjd}t||d}t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      rG  r   )r   r   r0  rZ   r   r   r   NaN)arraysr  rb   rB  serr&   r&   r'   series_with_multilevel_index  s   

rM  c                 C   s$   i | ]}|j  d tjd|dqS )z-seriesr   )r,   r  )r   r   make_rand_series)r   r  r&   r&   r'   rF    s    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
    Tr+  )_index_or_series_objsrp   r%  rq   r&   r&   r'   index_or_series_obj  s   rP  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_frame"  s   rR  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?     rU  c                   C   rS  )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   rQ  r&   r&   r&   r'   float_frame\  rV  rW  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   rS   r  )r   r   cr  r  rG  )r   rZ   r   aranger&   r&   r&   r'   mixed_type_framey  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t| | dS )zF
    Fixture for Series with a DatetimeIndex that has duplicates.
    i  rS   r   r      rR   rG  )r   r   rZ   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   i  )secondsztimedelta64[ns]c                 C   rn   r   ro   rq   r&   r&   r'   ea_scalar_and_dtype     rc  )__add____radd____sub____rsub____mul____rmul____floordiv____rfloordiv____truediv____rtruediv____pow____rpow____mod____rmod__c                 C   rn   )zD
    Fixture for dunder names for common arithmetic operations.
    ro   rq   r&   r&   r'   all_arithmetic_operators  rt   rs  c                 C   rn   )zU
    Fixture for operator and roperator arithmetic, comparison, and logical ops.
    ro   rq   r&   r&   r'   all_binary_operators     "rt  c                 C   rn   )z
    Fixture for operator and roperator arithmetic functions.

    Notes
    -----
    This includes divmod and rdivmod, whereas all_arithmetic_operators
    does not.
    ro   rq   r&   r&   r'   all_arithmetic_functions  s   rv  )
r   maxminmeanprodstdvarmediankurtskewc                 C   rn   )z.
    Fixture for numeric reduction names.
    ro   rq   r&   r&   r'   all_numeric_reductions"  rt   r  allanyc                 C   rn   )z.
    Fixture for boolean reduction names.
    ro   rq   r&   r&   r'   all_boolean_reductions-  rt   r  c                 C   rn   )z>
    Fixture for all (boolean + numeric) reduction names.
    ro   rq   r&   r&   r'   all_reductions8  rt   r  c                 C   rn   )z;
    Fixture for operator module comparison functions.
    ro   rq   r&   r&   r'   comparison_op@  rd  r  )__le____lt____ge____gt__c                 C   rn   )zm
    Fixture for dunder names for compare operations except == and !=

    * >=
    * >
    * <
    * <=
    ro   rq   r&   r&   r'   compare_operators_no_eq_neQ  rw   r  )__and____rand____or____ror____xor____rxor__c                 C   rn   )zY
    Fixture for dunder names for common logical operations

    * |
    * &
    * ^
    ro   rq   r&   r&   r'   all_logical_operators^     r  c                 C   s
   |  dS )zO
    Returns the configuration for the test setting `--strict-data-files`.
    r#   )r8   )pytestconfigr&   r&   r'   strict_data_fileso  s   
r  .c                    s(   t jt 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 g| R  }t j|s#rtd| dtd| d |S )NzCould not find file z  and --strict-data-files is set.zCould not find .)osr*   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'   datapathw  s   r  c                 C   s   t | ddddS )z*
    The iris dataset as a DataFrame.
    iorB  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&   rf   )r   ir&   r&   r'   r     s    c                 C   rn   )zD
    Fixture for trying timezones including default (None): {0}
    ro   rq   r&   r&   r'   tz_naive_fixture  r|   r  c                 C   rn   )z4
    Fixture for trying explicit timezones: {0}
    ro   rq   r&   r&   r'   tz_aware_fixture  r|   r  r   zdateutil/UTCc                 C   rn   )zQ
    Fixture to provide variants of UTC timezone strings and tzinfo objects.
    ro   rq   r&   r&   r'   utc_fixture  rt   r  c                 C   rn   )zR
    Parametrized fixture for string dtypes.

    * str
    * 'str'
    * 'U'
    ro   rq   r&   r&   r'   string_dtype     	r  pyarrowz1.0.0)min_versionc                 C   rn   )za
    Parametrized fixture for string dtypes.

    * 'string[python]'
    * 'string[pyarrow]'
    ro   rq   r&   r&   r'   nullable_string_dtype  r   r  pythonc                 C   rn   )zb
    Parametrized fixture for pd.options.mode.string_storage.

    * 'python'
    * 'pyarrow'
    ro   rq   r&   r&   r'   string_storage  s   r  c                 C   rn   )zK
    Parametrized fixture for bytes dtypes.

    * bytes
    * 'bytes'
    ro   rq   r&   r&   r'   bytes_dtype     r  c                 C   rn   )zN
    Parametrized fixture for object dtypes.

    * object
    * 'object'
    ro   rq   r&   r&   r'   object_dtype$  r  r  objectc                 C   rn   )zo
    Parametrized fixture for string dtypes.
    * 'object'
    * 'string[python]'
    * 'string[pyarrow]'
    ro   rq   r&   r&   r'   any_string_dtype/     r  c                 C   rn   )z\
    Parametrized fixture for datetime64 dtypes.

    * 'datetime64[ns]'
    * 'M8[ns]'
    ro   rq   r&   r&   r'   datetime64_dtypeB  r  r  c                 C   rn   )z^
    Parametrized fixture for timedelta64 dtypes.

    * 'timedelta64[ns]'
    * 'm8[ns]'
    ro   rq   r&   r&   r'   timedelta64_dtypeM  r  r  c                	   C   s   t ddddddddS )z-
    Fixture emits fixed Timestamp.now()
    i  rS   rT   r\        )r   rW   r   hourminuter   microsecond)r   r&   r&   r&   r'   fixed_now_tsX  s   r  c                 C   rn   )z^
    Parameterized fixture for float dtypes.

    * float
    * 'float32'
    * 'float64'
    ro   rq   r&   r&   r'   float_numpy_dtypeb  r  r  c                 C   rn   )zR
    Parameterized fixture for float dtypes.

    * 'Float32'
    * 'Float64'
    ro   rq   r&   r&   r'   float_ea_dtypen  r  r  c                 C   rn   )z~
    Parameterized fixture for float dtypes.

    * float
    * 'float32'
    * 'float64'
    * 'Float32'
    * 'Float64'
    ro   rq   r&   r&   r'   any_float_dtypey  r  r  c                 C   rn   )zg
    Parameterized fixture for complex dtypes.

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

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

    * 'uint8'
    * 'uint16'
    * 'uint32'
    * 'uint64'
    ro   rq   r&   r&   r'   any_unsigned_int_numpy_dtype  rw   r  c                 C   rn   )z
    Parameterized fixture for any integer dtype.

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

    * 'UInt8'
    * 'Int8'
    * 'UInt16'
    * 'Int16'
    * 'UInt32'
    * 'Int32'
    * 'UInt64'
    * 'Int64'
    ro   rq   r&   r&   r'   any_int_ea_dtype  rd  r  c                 C   rn   )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'
    ro   rq   r&   r&   r'   any_int_dtype  s   r  c                 C   rn   )z
    Parameterized fixture for any nullable integer dtype and
    any float ea dtypes.

    * 'UInt8'
    * 'Int8'
    * 'UInt16'
    * 'Int16'
    * 'UInt32'
    * 'Int32'
    * 'UInt64'
    * 'Int64'
    * 'Float32'
    * 'Float64'
    ro   rq   r&   r&   r'   any_numeric_ea_dtype  s   r  c                 C   rn   )z~
    Parameterized fixture for any signed nullable integer dtype.

    * 'Int8'
    * 'Int16'
    * 'Int32'
    * 'Int64'
    ro   rq   r&   r&   r'   any_signed_int_ea_dtype  rw   r  c                 C   rn   )z
    Parameterized fixture for any (purely) real numeric dtype.

    * int
    * 'int8'
    * 'uint8'
    * 'int16'
    * 'uint16'
    * 'int32'
    * 'uint32'
    * 'int64'
    * 'uint64'
    * float
    * 'float32'
    * 'float64'
    ro   rq   r&   r&   r'   any_real_numpy_dtype  s   r  c                 C   rn   )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'
    ro   rq   r&   r&   r'   any_numpy_dtype!  ru  r  c                 C   rn   )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'
    ro   rq   r&   r&   r'   any_numeric_dtypeF  s   $r  r   rY  mixedbytes   a   czmixed-integerr   g       @floatingrX  integerzmixed-integer-floatdecimal
datetime64z
2013-01-01z
2018-01-01r   20180101r   i  i  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   )rp   rZ   r   r  )rr   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:)r@   )r/   importorskipIPython.core.interactiveshellr  traitlets.configr  HistoryManager	hist_file)r  r  rY  r&   r&   r'   ip  s   
r  )bsrcoocsccsrdiadoklilc                 C   s   ddl m} t|| jd S )z-
    Yields scipy sparse matrix classes.
    r   )sparse_matrix)scipyr  getattrrp   )rr   r  r&   r&   r'   spmatrix  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     s    
c                 C   rn   )zN
    Fixture for Tick based datetime offsets available for a time series.
    ro   rq   r&   r&   r'   tick_classes  r  r  c                 C   s   | S r   r&   rh   r&   r&   r'   rj     s    c                 C   rn   )zk
    Simple fixture for testing keys in sorting methods.
    Tests None (no key) and the identity key.
    ro   rq   r&   r&   r'   sort_by_key  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   c                    s(   | dd | jd< t jdi | d S )Ntestr   r&   )popr  superr   )r   r   	__class__r&   r'   r     s   z)fsspectest.<locals>.TestMemoryFS.__init__r   )r   r   r   protocolr  r   __classcell__r&   r&   r  r'   TestMemoryFS  s    r   r  T)clobber)r/   r  r  r  fsspec.implementations.memoryr  fsspec.registryr  r  r  storeclear)r  r  registryr   r&   r&   r'   
fsspectest  s   

r  )r   NN)EgonVenkmanN)NCC1701Dr
  r
  c                 C   rn   )zP
    A 3-tuple of names, the first two for operands, the last for a result.
    ro   rq   r&   r&   r'   r   	  r  r   c                 C   rn   )zI
    Parametrize over __setitem__, loc.__setitem__, iloc.__setitem__
    ro   rq   r&   r&   r'   indexer_sli  rt   r  c                 C   rn   )z<
    Parametrize over loc.__getitem__, iloc.__getitem__
    ro   rq   r&   r&   r'   
indexer_li$  rt   r  c                 C   rn   )z8
    Parametrize over __setitem__, iloc.__setitem__
    ro   rq   r&   r&   r'   
indexer_si,  rt   r  c                 C   rn   )z7
    Parametrize over __setitem__, loc.__setitem__
    ro   rq   r&   r&   r'   
indexer_sl4  rt   r  c                 C   rn   )z:
    Parametrize over at.__setitem__, loc.__setitem__
    ro   rq   r&   r&   r'   
indexer_al<  rt   r  c                 C   rn   )z<
    Parametrize over iat.__setitem__, iloc.__setitem__
    ro   rq   r&   r&   r'   indexer_ialD  rt   r  c                   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_managerL  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_writeT  s   r  r   (   __doc__collectionsr   r   r   r   r   r   r  r   operatorr  typingr	   dateutil.tzr
   r   
hypothesisr   stnumpyrZ   r/   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   r  paImportErrorhas_pyarrowzoneinfocompatPY39ZoneInfoZoneInfoNotFoundErrorr0   r1   r<   r(   Itemstrr2   rJ   settingsregister_profileHealthChecktoo_slowload_profilesplitr,   r  tseriesr  clsregister_type_strategybuildsintegersbooleansfixturer7   ra   rs   
axis_frameru   rv   rx   r{   r   r   r   rp   
skip_if_nor   r   r   r   r   NULL_OBJECTSr   nulls_fixture2nan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makeIntIndexmakeUIntIndexmakeRangeIndexmakeFloatIndexr   makeNumericIndexmakeBoolIndexr  r   r   makeCategoricalIndexmakeIntervalIndexr0  r   rZ  boolr$  idxkeysrb   index_fixture2r(  index_flat2r3  r8  r<  r?  rC  r?   _seriesrH  rM  NARROW_NP_DTYPES_narrow_seriesrO  rP  rR  rU  rW  r[  r^  rc  _all_arithmetic_operatorsrs  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_rt  rv  _all_numeric_reductionsr  _all_boolean_reductionsr  _all_reductionsr  r  r  r  r  r  r  	TIMEZONESextendTIMEZONE_IDSparametrize_fixture_docr  r  tz_aware_fixture2_UTCSappendr  utc_fixture2STRING_DTYPESr  r  r  string_storage2BYTES_DTYPESr  OBJECT_DTYPESr  r  DATETIME64_DTYPESr  TIMEDELTA64_DTYPESr  r  FLOAT_NUMPY_DTYPESr  FLOAT_EA_DTYPESr  r  COMPLEX_DTYPESr  SIGNED_INT_NUMPY_DTYPESr  UNSIGNED_INT_NUMPY_DTYPESr  ALL_INT_NUMPY_DTYPESr  ALL_INT_EA_DTYPESr  r  r  SIGNED_INT_EA_DTYPESr  ALL_REAL_NUMPY_DTYPESr  ALL_NUMPY_DTYPESr  r  NAr  _any_skipna_inferred_dtyperm   _r  r  r  __all__r  r  r  r   setitemlocilocr  r  r  r  atr  iatr  r  r  r&   r&   r&   r'   <module>   s@    
<





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
























	


 !"#%

	
			












$"





	


	
$#$$2	