&VfieF5dZddlmZddlmZddlmZmZmZmZm Z ddl m Z ddl Z ddl Z ddlmZmZddlmZmZddlZdd lmZddlZddlZdd lmZmZdd lmZddlm cm!Z"dd l#m$Z$m%Z%ddl&Z'dd l&m(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3ddl4m5Z6ddl7m8Z8ddl9m:Z:m;Z;ddlm?Z?m@Z@ ddlAZB[BdZCn #eD$rdZCYnwxYwddlEZE eEjFdn#eEjG$rdZEYnwxYwdWdZHdXdZIdWdZJejKjLgZMe=ejNe=dkreMOejKjPejQRd deSeM!ejQTd d"UD]VZVeWe'jXjYeVZZej[eZej\eZej]d#d$ej^%Wd&UD]gZVeWe'jXjYeVZZej[eZej\eZej]d'd(ej^ej]d)d*+,hd-UD]gZVeWe'jXjYeVZZej[eZej\eZej]d.d/ej^ej]d)d*+0hej_d1dWd2Z`ej_d1dWd3Zaej_gd4d56d7ZbebZcej_d)d8gd96d:Zdej_gd;<d=Zeej_gd;<d>Zfej_ddg<d?Zgej_gd@<dAZhej_gdB<dCZiej_gdD<dEZjej_gdD<dFZkej_ddGdHdIdJdKejldLe"jmdMNg<dOZnej_dGdHdIdJdKejldLe"jmdMNg<dPZoej_ddg<dQZpej_gdR<dSZqej_dTdUg<dVZrej_e6jsdW6dXZtetZuej_dejve'jwg<dYZxexZyej_e6jzdZ6d[Z{e{Z|ej_e)e.g<d\Z}ej_e:e.gd]d^g6d_Z~e~Zej_e:e.e'jggd`6daZej_e:e.e)e'jgdb6dcZeZej_dYdeZej_dZdgZej_dhZej_d[djZej_d\dlZdmZdnZidoe:dpedqDerdse:dtedqDdrdue1dvdqwdxe1dvdqdyzd{e2dvdqd|}d~e3ddqd|de-dqde:ejdqdrde:ejdqdrde:ejdqdrde:ejdqdrde:ejdqdrde:ejdqdrde:ejdqdrde:ejdqdrde:ejdqdrde:ejdqdride:ddgd(zerde:ddgd(zerde:ejdqdrdejdqdrzzde:ejdqdrdejdqdrzzde(eddzde+jejddqdde:gde;jegdgddedede:gdde:ejdqdrde:ejdqdrde:ejdqdrde:ejdqedrde:e'jdedqDdrZeCr3e:e'jdedqDdrZeed<ej_e<dZeZej_deD<dZeZej_deD<dZej_d]dZej_d]dZej_d]dZdZdeDZej_d]dZde6jDZieeeZej_e<dZde6jDZieeeeZej_e<dZej_d\dZej_d\dZej_d]dZej_e*dd(e%ddfe*ddìe%ddfe,ddŬƦdfe,dd|Ʀdfe0ddˬ̦e$ddˬΦfe/dϬЦdfg<d҄Zej_e6j<dӄZej_e je8je je8je je8je je8je je8je je8je je8je je je je je je je je8je je8je je8jg<dԄZej_e je8je je8je je8je je8je je8je je8je je8jg<dՄZgd֢Zej_eά<dׄZddgZej_eЬ<dڄZeezZej_eҬ<dۄZej_e je je je je je jg<d܄Zej_gdݢ<dބZej_gdߢ<dZgdZej_e׬<dZej_dZej_d^dZddddddddddeeededede je ed)e eddgZeE3e۠eEjFdyeEjFdgdeDZe"jeeݦej_eeݬ6dZe"jeed)dej_ed)ded)d6dZeZddeee jgZeE#eOeEjFdej_e<dZeZej_gd<dZeZej_e6j<dZej_de'jfejlde'jfe"jmdNejldejvfe"jmdNdejvfggd6dZej_dejlde"jmdNg<dZej_ejldejvfe"jmdNejlde'jfe"jmdNg<dZej_dejlde"jmdNg<dZej_de'jfejlde'jfe"jmdNejldejvfe"jmdNdejvfggd6dZej_dejlde"jmdNg<dZeZeZej_e6j<dZej_e6j<dZej_ejdode'jfejlde'jfe"jmdNejldejvfe"jmdNdejvfggd 6d Zej_e6j<d Zej_e6j<d Zej_d_dZej_e6j<dZej_e6j<dZej_e6j<dZej_e6j<dZej_e6j<dZej_e6j<dZ ej_e6j <dZ ej_e6j <dZ ej_e6j<dZej_e6j<dZej_e6je6jz<dZej_e6je6jze6jze6jz<dZej_e6j<dZej_e6j<dZej_e6j<dZej_e6j<dZej_e6j<dZej_e6j <d Z!dsd!ejvd"gfdsd!e'jd"gfd#d!e'jwd"gfd$d%ejvd&gfdejvejvejvgfdgfd'd!ejvd(gfd#d!ejvd)gfd*d+ejvd)gfd,d)ejvd(gfd-d)ejvd)gfd.e d)ejve d(gfddejvdgfdde'jdgfd/ej"d0ejvej"d1gfdue0d2ejve0d3gfd4ed5d)d)ejved6d)d)gfd7d8ejvd9gfd~ed)ejved(gfd:ed)ejved(gfd{e,d5e'jwe,d6gfde*dd)ejve*dd(gfgZ#ee#\Z$Z%ej_e#e$6d;Z&ej_d<Z'ej_gd=<d>Z(ej_d?e'jYj)D<d@Z*ej_ddAg<dBZ+ej_dCdDdEejvejvejvfejve'jwdfejve'jdfe'je'je'jfg<d`dGZ,ej_e6j-e6j.e6j/g<dHZ0ej_e6j.e6j/g<dIZ1ej_e6j-e6j/g<dJZ2ej_e6j-e6j.g<dKZ3ej_e6j4e6j.g<dLZ5ej_e6j6e6j/g<dMZ7ej_dadOZ8ej_dadPZ9ej_dadQZ:ej_dadRZ;dSdTgZdS(ca 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)datedatetimetime timedeltatimezone)DecimalN) TYPE_CHECKINGCallable)tzlocaltzutc) strategies) FixedOffsetutc _get_option)DatetimeTZDtype IntervalDtype) CategoricalIndex DataFrameInterval IntervalIndexPeriod RangeIndexSeries Timedelta Timestamp date_range period_rangetimedelta_range)ops)Index MultiIndex)Version)HashableIteratorTFUTCreturnNonec6|ddddS)N--no-strict-data-files store_falsez6Don't fail if a test is skipped for missing data file.)actionhelp) addoption)parsers >c:\PYTHON\DbComparer\venv\Lib\site-packages\pandas/conftest.pypytest_addoptionr3os2   Eitem pytest.Itempathstrmessagec|j|r7|tjd|dSdS)aIgnore 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. zignore:N)nameendswith add_markerpytestmarkfilterwarnings)r5r7r9s r2ignore_doctest_warningrAwsZ y$I  223FW3F3FGGHHHHHIIr4c|dp|dd}gd}|r|D]}|D]\}}t|||dSdS)Nz--doctest-modulesz--doctest-cythonF)default))is_int64_dtypezis_int64_dtype is deprecated)is_interval_dtypezis_interval_dtype is deprecated)is_period_dtypezis_period_dtype is deprecated)is_datetime64tz_dtypez#is_datetime64tz_dtype is deprecated)is_categorical_dtypez"is_categorical_dtype is deprecated) is_sparsezis_sparse is deprecated)DataFrameGroupBy.fillnaz%DataFrameGroupBy.fillna is deprecated)NDFrame.replacezThe 'method' keyword)rKzSeries.replace without 'value')z NDFrame.clipz4Downcasting behavior in Series and DataFrame methods)z Series.idxminThe behavior of Series.idxmin)z Series.idxmaxThe behavior of Series.idxmax)zSeriesGroupBy.fillnaz"SeriesGroupBy.fillna is deprecated)zSeriesGroupBy.idxminrL)zSeriesGroupBy.idxmaxrM)zmissing.mask_zero_div_zerozdivide 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)zResampler.fillnaz+DatetimeIndexResampler.fillna is deprecated)rJz3DataFrameGroupBy.fillna with 'method' is deprecated)rJz,DataFrame.fillna with 'method' is deprecated) read_parquetz1Passing a BlockManager to DataFrame is deprecated) getoptionrA)itemsconfig is_doctestignored_doctest_warningsr5r7r9s r2pytest_collection_modifyitemsrUs!!"566&:J:JE;K;;J - - - ^< < rysARaARARr4)paramsidsc|jS)z@ Fixture for returning the axis numbers of a DataFrame. paramrequests r2axisr =r4rrc&dt|Srtrurws r2ryrys5FT!WW5F5Fr4c|jS)zA Fixture for returning aliases of axis 1 of a DataFrame. r}rs r2axis_1rrr4)TFN)rzc|jS)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). r}rs r2observedr'  =r4c|jS)z6 Boolean 'ordered' parameter for Categorical. r}rs r2orderedr4rr4c|jS)z% Boolean 'skipna' parameter. r}rs r2skipnar<rr4)firstlastFc|jS)z[ Valid values for the 'keep' parameter used in .duplicated or .drop_duplicates r}rs r2keeprD =r4)bothneitherleftrightc|jS)zA Fixture for trying all interval 'inclusive' parameters. r}rs r2inclusive_endpoints_fixturerMrr4)rrrrc|jS)z< Fixture for trying all interval closed parameters. r}rs r2closedrUrr4c|jS)zS Secondary closed fixture to allow parametrizing over all pairs of closed. r}rs r2 other_closedr]rr4gzipbz2zipxztarzstd zstandard)marksc|jS)zK Fixture for trying common compression types in compression tests. r}rs r2 compressionre  =r4c|jS)zk Fixture for trying common compression types in compression tests excluding uncompressed case. r}rs r2compression_onlyrwrr4c|jS)z, Fixture that an array is writable. r}rs r2writablerrr4)innerouterrrc|jS)z: Fixture for trying all types of join operations. r}rs r2 join_typerrr4nlargest nsmallestc|jS)z1 Fixture for trying all nselect methods. r}rs r2nselect_methodrrr4c*t|jSNtype__name__rws r2ryrysd1gg6Fr4c|jS)z/ Fixture for each null type in pandas. r}rs r2 nulls_fixturerrr4c|jS)zL Fixture for each null type in pandas, each null type exactly once. r}rs r2unique_nulls_fixturerrr4c*t|jSrrrws r2ryrysQ8Hr4c|jS)z- Fixture for each NaT type in numpy. r}rs r2np_nat_fixturerrr4c|jS)z; Fixture to parametrize over DataFrame and Series. r}rs r2frame_or_seriesrrr4rqseriesc|jS)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 r}rs r2index_or_seriesrrr4)rqrarrayc|jS)zG Fixture to parametrize over Index, Series, and ExtensionArray r}rs r2index_or_series_or_arrayrrr4c|jSr)rrws r2ryrys1:r4c|jS)z] Fixture to test behavior for Index, Series, DataFrame, and pandas Array classes r}rs r2box_with_arrayrrr4 type[dict]c,Gddt}|S)z, Fixture for a dictionary subclass. ceZdZddZdS)"dict_subclass..TestSubDictr)r*c0tj|g|Ri|dSr)dict__init__)selfargskwargss r2rz+dict_subclass..TestSubDict.__init__s( M$ 0 0 0 0 0 0 0 0 0r4Nr)r*)r __module__ __qualname__rror4r2 TestSubDictrs( 1 1 1 1 1 1r4r)r)rs r2 dict_subclassrs4 11111d111 r4type[abc.Mapping]c6Gddtj}|S)z8 Fixture for a non-mapping dictionary subclass. c,eZdZd dZdZd dZd dZd S) 5non_dict_mapping_subclass..TestNonDictMappingr)r*c||_dSr)_data)runderlying_dicts r2rz>non_dict_mapping_subclass..TestNonDictMapping.__init__ s (DJJJr4c6|j|Sr)r __getitem__)rkeys r2rzAnon_dict_mapping_subclass..TestNonDictMapping.__getitem__s:))#.. .r4r'c4|jSr)r__iter__rs r2rz>non_dict_mapping_subclass..TestNonDictMapping.__iter__s:&&(( (r4intc4|jSr)r__len__rs r2rz=non_dict_mapping_subclass..TestNonDictMapping.__len__s:%%'' 'r4Nr)r)r')r)r)rrrrrrrror4r2TestNonDictMappingr s_ ) ) ) ) / / / ) ) ) ) ( ( ( ( ( (r4r)rMapping)rs r2non_dict_mapping_subclassrs6 ( ( ( ( (S[ ( ( ( r4c ttjddt t dtddd}|d d d g }|j d |j j D|_ |j gd d|S)z DataFrame with 3 level MultiIndex (year, month, day) covering first 100 business days from 2000-01-01 with random data )dABCD 2000-01-01rBperiodsfreq)rrrqc|jSr)yearrws r2ryzAmultiindex_year_month_day_dataframe_random_data..*sr4c|jSr)rbrws r2ryzAmultiindex_year_month_day_dataframe_random_data..*s17r4c|jSr)dayrws r2ryzAmultiindex_year_month_day_dataframe_random_data..*saer4c8g|]}|dS)i8)astype).0levs r2 zCmultiindex_year_month_day_dataframe_random_data..,s$%S%S%S3cjj&6&6%S%S%Sr4)rrbrT)inplace)rrgrandom default_rngstandard_normalr#listrgroupbysumrq set_levelslevels set_names)tdfymds r2/multiindex_year_month_day_dataframe_random_datar s  a  00::d6ll##s===   C ++''):):OOL M M Q Q S SC $$%S%S#)BR%S%S%STTCII000$??? Jr4r$cBtgdgdggdgdgddgS)z; 2-level MultiIndex, lexsorted, with string names. foobarbazquxonetwothree) rrrr^r^rrrr) rr^rrr^r^rrr^rrsecond)r codesnames)r$ror4r2%lexsorted_two_level_string_multiindexr1sM ,,,.E.E.EF---/M/M/MN!   r4rc|}ttjdd|t gddS)z2DataFrame with 2 level MultiIndex with random datar) r)ArCexpr;rqrr)rrgrrrr#)rrqs r2 multiindex_dataframe_random_datar$=sX 2E  a  0099oooE222   r4ctgd}tddg}tjgd}tjgd}ddg}t||g||g|d S) zJ MultiIndex used to test the general functionality of this object rrr)rrr^rrr)rr^rr^rr^rrF)r rrverify_integrity)r#rgrr$) major_axis minor_axis major_codes minor_codes index_namess r2_create_multiindexr,Js 33344Ju~&&J(---..K(---..KH%K J'K(    r4c `tjddgddgtdddggd  S) zB MultiIndex with a level that is a tzaware DatetimeIndex. r^rab20130101r US/Easternrtzr)r)r$ from_productrror4r2_create_mi_with_dt64tz_levelr5^sH  " Q#sZ A,OOOP%%%   r4objectcg|]}d|Spandas_roris r2rrj777q]q]]777r4rdtypestringcg|]}d|Sr8ror:s r2rrkr<r4rz 2020-01-01)rz datetime-tzz US/Pacificr2periodDrrz1 day)startrrrangeint8int16int32int64uint8uint16uint32uint64float32float64z bool-object bool-dtype complex64y? complex128 categoricalabcdintervale)numemptytuples)rrr)r^rrmi-with-dt64tz-levelmultirepeats)rrr^r^rr nullable_intInt64 nullable_uintUInt16nullable_floatFloat32 nullable_boolbooleanz string-pythoncg|]}d|Sr8ror:s r2rrs444A-A--444r4zstring[python]cg|]}d|Sr8ror:s r2rrs<<.s111!X!XX111r4rrqr;)rrgarangerNr#rDror4r2 string_seriesrsW  "BJ'''#-11uRyy11122    r4cdtdD}tdtdD}t||dtS)zI Fixture for Series of dtype object with Index of unique strings cg|]}d|Sfoo_ror:s r2rz!object_series..s * * *1J1JJ * * *r4rcg|]}d|S)bar_ror:s r2rz!object_series..s111!:!::111r4objectsrqr;r>)rDr#rr6)datarqs r2 object_seriesrsV + *b * * *D 11uRyy111 2 2E $e)6 B B BBr4cttjddt ddddS)z9 Fixture for Series of floats with DatetimeIndex rrrrrtsr)rrgrrrrror4r2datetime_seriesrsQ  a  0044r<<<    r4ct|}tjd|}t ||ddS)zHelper for the _series dictrr.F)rqr;ri)lenrgrrrr)rqsizers r2_create_seriesrsG u::D 9  # # 3 3D 9 9D $e#E : : ::r4c<i|]\}}d|dt|S)z series-with-z-indexr)rindex_idrqs r2 r sA   %$8###^E%:%:   r4c t|S)zE Fixture for tests on series with changing types of indices. rrqs r2series_with_simple_indexrs %  r4c i|]B}|jdttddtdDd|CS)-seriesrcg|]}d|S)zi-ror:s r2rz.s666q(q((666r4r.r)rrrDrr>s r2rrsj  ~ b 66E"II666S!!!r4cNt|jdS)z| Fixture for tests on indexes, series and series with a narrow dtype copy to avoid mutation, e.g. setting .name Tru)_index_or_series_objsr~rirs r2index_or_series_objr%s" ! / 4 4$ 4 ? ??r4c>i|]}|jdt|S)r)rrrs r2rr.s827u~u r4cNt|jdS)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 Tru)_index_or_series_memory_objsr~rirs r2index_or_series_memory_objr;s" ( 6 ; ; ; F FFr4c ttjdtjt dt dDt t dS)zj Fixture for DataFrame of ints with index of unique strings Columns are ['A', 'B', 'C', 'D'] rrr=cg|]}d|Srror:s r2rzint_frame..Q333AZAZZ333r4rrr#)rrgonesrHr#rDrror4r2 int_framerHs`  rx(((33r33344d6ll##   r4c ttjddt dt dDt tdS)zm Fixture for DataFrame of floats with index of unique strings Columns are ['A', 'B', 'C', 'D']. rrcg|]}d|Srror:s r2rzfloat_frame.._rr4rrr#)rrgrrrr#rDrror4r2 float_framerVsm  a  009933r33344d6ll##   r4ctdddtdddtdddtdddtdddtdddtdddtdddtdddtdddg }ttjdt ||S)zF Fixture for Series with a DatetimeIndex that has duplicates. ir^rrrr]r)rrrgrrrr)datess r2(rand_series_with_duplicate_datetimeindexrds q!q!q!q!q!q!q!q!q!q! E ")''**::3u::FFe T T TTr4)rrrg?g?z2012-01M)rz period[M]z 2012-02-01z period[D]z 2011-01-01r1)r3s)unitr3i)secondsztimedelta64[ns]c|jSrr}rs r2ea_scalar_and_dtyper|  =r4c|jS)zD Fixture for dunder names for common arithmetic operations. r}rs r2all_arithmetic_operatorsrrr4c|jS)zU Fixture for operator and roperator arithmetic, comparison, and logical ops. r}rs r2all_binary_operatorsr D =r4c|jS)z Fixture for operator and roperator arithmetic functions. Notes ----- This includes divmod and rdivmod, whereas all_arithmetic_operators does not. r}rs r2all_arithmetic_functionsrs 6 =r4) countrmaxminmeanprodstdvarmediankurtskewsemc|jS)z. Fixture for numeric reduction names. r}rs r2all_numeric_reductionsrrr4allanyc|jS)z. Fixture for boolean reduction names. r}rs r2all_boolean_reductionsrrr4c|jS)z> Fixture for all (boolean + numeric) reduction names. r}rs r2all_reductionsrrr4c|jS)z; Fixture for operator module comparison functions. r}rs r2 comparison_opr rr4)__le____lt____ge____gt__c|jS)zm Fixture for dunder names for compare operations except == and != * >= * > * < * <= r}rs r2compare_operators_no_eq_nerrr4)__and____rand____or____ror____xor____rxor__c|jS)zY Fixture for dunder names for common logical operations * | * & * ^ r}rs r2all_logical_operatorsr)  =r4)cumsumcumprodcummincummaxc|jS)z0 Fixture for numeric accumulation names r}rs r2all_numeric_accumulationsr:rr4c,|dS)zR Returns the configuration for the test setting `--no-strict-data-files`. r,)rP) pytestconfigs r2strict_data_filesrEs  ! !": ; ;;r4rCallable[..., str]ctjtjtdfd}|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. testsctjjg|R}tj|s-rt d|dt jd|d|S)NzCould not find file z' and --no-strict-data-files is not set.zCould not find .)osr7joinexists ValueErrorr>skip)rr7 BASE_PATHrs r2decozdatapath..decobs}w|I----w~~d## 3   X4XXX K1$111 2 2 2 r4)rr7rdirname__file__)rrrs` @r2datapathrMsN& RW__X66@@I Kr4z Asia/Tokyozdateutil/US/Pacificzdateutil/Asia/Singaporez+01:15z-02:15z UTC+01:15z UTC-02:15i,i)hoursrwrr"c,g|]}t|Srorur:s r2rrs+++AQ+++r4c|jS)zD Fixture for trying timezones including default (None): {0} r}rs r2tz_naive_fixturerrr4c|jS)z4 Fixture for trying explicit timezones: {0} r}rs r2tz_aware_fixturerrr4rz dateutil/UTCc|jS)zQ Fixture to provide variants of UTC timezone strings and tzinfo objects. r}rs r2 utc_fixturerrr4)rmsusnsc|jS)z& datetime64 units we support. r}rs r2rrrr4c|jS)zR Parametrized fixture for string dtypes. * str * 'str' * 'U' r}rs r2 string_dtyper   =r4pythonpyarrow)string=string[python]string=string[pyarrow]string=str[pyarrow]string=str[python]c@|j\}}tj||S)z Parametrized fixture for string dtypes. * 'string[python]' (NA variant) * 'string[pyarrow]' (NA variant) * 'str' (NaN variant, with pyarrow) * 'str' (NaN variant, without pyarrow) )r~rh StringDtyperstoragena_values r2string_dtype_no_objectrs"0 GX >'8 , ,,r4c|jS)za Parametrized fixture for string dtypes. * 'string[python]' * 'string[pyarrow]' r}rs r2nullable_string_dtyper  =r4c(tj|jS)zq Parametrized fixture for string dtypes backed by Pyarrow. * 'str[pyarrow]' * 'string[pyarrow]' )rhrr~rs r2pyarrow_string_dtypers >7= ))r4c|jSzb Parametrized fixture for pd.options.mode.string_storage. * 'python' * 'pyarrow' r}rs r2string_storager  rr4c|jS)z Parametrized fixture for StringDtype storage and na_value. * 'python' + pd.NA * 'pyarrow' + pd.NA * 'pyarrow' + np.nan r}rs r2string_dtype_argumentsr"s , =r4numpy_nullablec|jSrr}rs r2 dtype_backendr%5rr4c|jS)zK Parametrized fixture for bytes dtypes. * bytes * 'bytes' r}rs r2 bytes_dtyper'J  =r4c|jS)zN Parametrized fixture for object dtypes. * object * 'object' r}rs r2 object_dtyper*Ur(r4)z string=objectrrrrct|jtjr|jS|j\}}t j||S)z Parametrized fixture for string dtypes. * 'object' * 'string[python]' (NA variant) * 'string[pyarrow]' (NA variant) * 'str' (NaN variant, with pyarrow) * 'str' (NaN variant, without pyarrow) )rkr~rgr>rhrrs r2any_string_dtyper,`sB2'-**1}$M~gx000r4c|jS)z\ Parametrized fixture for datetime64 dtypes. * 'datetime64[ns]' * 'M8[ns]' r}rs r2datetime64_dtyper.r(r4c|jS)z^ Parametrized fixture for timedelta64 dtypes. * 'timedelta64[ns]' * 'm8[ns]' r}rs r2timedelta64_dtyper0r(r4rc .tdddddddS)z- Fixture emits fixed Timestamp.now() ir^r_r )rrbrhourminuter microsecond)rror4r2 fixed_now_tsr7s*  1RR   r4c|jS)z^ Parameterized fixture for float dtypes. * float * 'float32' * 'float64' r}rs r2float_numpy_dtyper9r r4c|jS)zR Parameterized fixture for float dtypes. * 'Float32' * 'Float64' r}rs r2float_ea_dtyper;r(r4c|jS)z~ Parameterized fixture for float dtypes. * float * 'float32' * 'float64' * 'Float32' * 'Float64' r}rs r2any_float_dtyper=rr4c|jS)zg Parameterized fixture for complex dtypes. * complex * 'complex64' * 'complex128' r}rs r2 complex_dtyper?r r4c|jS)z Parameterized fixture for complex and numpy float dtypes. * complex * 'complex64' * 'complex128' * float * 'float32' * 'float64' r}rs r2complex_or_float_dtyperAs  =r4c|jS)z| Parameterized fixture for signed integer dtypes. * int * 'int8' * 'int16' * 'int32' * 'int64' r}rs r2any_signed_int_numpy_dtyperCrr4c|jS)zx Parameterized fixture for unsigned integer dtypes. * 'uint8' * 'uint16' * 'uint32' * 'uint64' r}rs r2any_unsigned_int_numpy_dtyperErr4c|jS)z Parameterized fixture for any integer dtype. * int * 'int8' * 'uint8' * 'int16' * 'uint16' * 'int32' * 'uint32' * 'int64' * 'uint64' r}rs r2any_int_numpy_dtyperGrr4c|jS)z Parameterized fixture for any nullable integer dtype. * 'UInt8' * 'Int8' * 'UInt16' * 'Int16' * 'UInt32' * 'Int32' * 'UInt64' * 'Int64' r}rs r2any_int_ea_dtyperIrr4c|jS)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' r}rs r2 any_int_dtyperK s . =r4c|jS)z Parameterized fixture for any nullable integer dtype and any float ea dtypes. * 'UInt8' * 'Int8' * 'UInt16' * 'Int16' * 'UInt32' * 'Int32' * 'UInt64' * 'Int64' * 'Float32' * 'Float64' r}rs r2any_numeric_ea_dtyperM:s " =r4c|jS)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]' r}rs r2any_numeric_ea_and_arrow_dtyperOPs @ =r4c|jS)z~ Parameterized fixture for any signed nullable integer dtype. * 'Int8' * 'Int16' * 'Int32' * 'Int64' r}rs r2any_signed_int_ea_dtyperQsrr4c|jS)z Parameterized fixture for any (purely) real numeric dtype. * int * 'int8' * 'uint8' * 'int16' * 'uint16' * 'int32' * 'uint32' * 'int64' * 'uint64' * float * 'float32' * 'float64' r}rs r2any_real_numpy_dtyperSs $ =r4c|jS)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. r}rs r2any_real_numeric_dtyperUs ( =r4c|jS)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' r}rs r2any_numpy_dtyperWrr4c|jS)a Parameterized fixture for all real dtypes that can hold NA. * float * 'float32' * 'float64' * 'Float32' * 'Float64' * 'UInt8' * 'UInt16' * 'UInt32' * 'UInt64' * 'Int8' * 'Int16' * 'Int32' * 'Int64' * 'uint8[pyarrow]' * 'uint16[pyarrow]' * 'uint32[pyarrow]' * 'uint64[pyarrow]' * 'int8[pyarrow]' * 'int16[pyarrow]' * 'int32[pyarrow]' * 'int64[pyarrow]' * 'float[pyarrow]' * 'double[pyarrow]' r}rs r2any_real_nullable_dtyperYs : =r4c|jS)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' r}rs r2any_numeric_dtyper[s > =r4r.cmixedbytesacz mixed-integerrg@floatingg?integerzmixed-integer-floatdecimal datetime64z 2013-01-01z 2018-01-01r020180101riicomplexy??y@@rcT|j\}}tj|t}||fS)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=)r~rgrr6)rinferred_dtyperxs r2any_skipna_inferred_dtyperi2s2R%]NF XfF + + +F 6 !!r4ctjddddlm}ddlm}|}d|j_||S) zj Get an instance of IPython.InteractiveShell. Will raise a skip if IPython is not installed. IPythonz6.0.0) minversionr)InteractiveShell)Configz:memory:)rR)r> importorskipIPython.core.interactiveshellrmtraitlets.configrnHistoryManager hist_file)rmrnr\s r2iprtesj  g6666>>>>>>('''''A!+A  1 % % %%r4)bsrcoocsccsrdiadoklilcZtjd}t||jdzS)z- Yields scipy sparse matrix classes. z scipy.sparse_matrix)r>rogetattrr~)rsparses r2spmatrixrxs+   0 0F 67=94 5 55r4cg|]Y}tttj|tjjr |dk?ttj|ZS)Tick) issubclassr~rhoffsetsr)ros r2rrs[    gbj!,,bjo > > DE;;  ACN;;r4c|jS)zN Fixture for Tick based datetime offsets available for a time series. r}rs r2 tick_classesrrr4c|Srrorws r2ryrysr4c|jS)zk Simple fixture for testing keys in sorting methods. Tests None (no key) and the identity key. r}rs r2 sort_by_keyrrr4)rNN)EgonVenkmanN)NCC1701Drr#tuple[Hashable, Hashable, Hashable]c|jS)zP A 3-tuple of names, the first two for operands, the last for a result. r}rs r2rrs =r4c|jS)zI Parametrize over __setitem__, loc.__setitem__, iloc.__setitem__ r}rs r2 indexer_slirrr4c|jS)z< Parametrize over loc.__getitem__, iloc.__getitem__ r}rs r2 indexer_lirrr4c|jS)z8 Parametrize over __setitem__, iloc.__setitem__ r}rs r2 indexer_sirrr4c|jS)z7 Parametrize over __setitem__, loc.__setitem__ r}rs r2 indexer_slrrr4c|jS)z: Parametrize over at.__setitem__, loc.__setitem__ r}rs r2 indexer_alrrr4c|jS)z< Parametrize over iat.__setitem__, iloc.__setitem__ r}rs r2 indexer_ialrrr4boolc,tdddkS)z> Fixture to check if the array manager is being used. mode.data_managerTsilentrrror4r2using_array_managerrs *4 8 8 8G CCr4c\tjjjduot dddkS)z7 Fixture to check if Copy-on-Write is enabled. Trrblockrhoptionsmode copy_on_writerror4r2using_copy_on_writers4 %- E +D 9 9 9W Dr4c`tjjjdkot dddkS)z? Fixture to check if Copy-on-Write is in warning mode. warnrTrrrror4r2warn_copy_on_writers4 %/ E +D 9 9 9W Dr4c2tjjjduS)z= Fixture to check if infer string option is enabled. T)rhrfuture infer_stringror4r2using_infer_stringrs :  )T 11r4z Europe/Warsawzdateutil/Europe/Warsawc|jS)zE tzinfo for Europe/Warsaw using pytz, dateutil, or zoneinfo. r}rs r2warsawrrr4cdS)N)r pyarrow_numpyroror4r2arrow_string_storagers ' 'r4r)r5r6r7r8r9r8r)r*)r)r)r)r)r)r$)r)r)r)r)rr8r)r)r)r)r)r)r)r)r)r8(?__doc__ __future__r collectionsrrrrrr rcr operatorrtypingr r dateutil.tzr r hypothesisrstnumpyrgr>pytzrrpandas._config.configrpandas.util._test_decoratorsutil_test_decoratorstdpandas.core.dtypes.dtypesrrpandasrhrrrrrrrrrrr r!pandas._testing_testingtm pandas.corer"pandas.core.indexes.apir#r$pandas.util.versionr%collections.abcr&r'rpa has_pyarrow ImportErrorzoneinfoZoneInfoZoneInfoNotFoundErrorr3rArU HealthChecktoo_slowhypothesis_health_checks __version__appenddiffering_executorssettingsregister_profiletuple load_profilesplitr;r~tseriesrclsregister_type_strategybuildsintegersbooleansfixturerjrpr axis_framerrrrrrrrr~ skip_if_norrrrr NULL_OBJECTSrnulls_fixture2nanNaTrunique_nulls_fixture2NP_NAT_OBJECTSrnp_nat_fixture2rrindex_or_series2rrrbox_with_array2rrr rr$r,r5rDr6rrr from_breakslinspacerzrrrhidxkeysrqindex_fixture2rQro index_flat2r}rrrr_seriesrNARROW_NP_DTYPES_narrow_seriesrrPYTHON_DATA_TYPES_typ_objects_seriesrrrrrrarithmetic_dunder_methodsraddraddsubrsubmulrmultruedivrtruedivfloordiv rfloordivmodrmodpowrpoweqneltlegtgeand_rand_xorrxoror_ror_rr_all_numeric_reductionsr_all_boolean_reductionsr_all_reductionsrrrr_all_numeric_accumulationsrrr TIMEZONESextend TIMEZONE_IDSparametrize_fixture_docr8rrtz_aware_fixture2_UTCSr utc_fixture2runit2 STRING_DTYPESr NArrrr r"r%string_storage2string_dtype_arguments2 BYTES_DTYPESr' OBJECT_DTYPESr*r>r,DATETIME64_DTYPESr.TIMEDELTA64_DTYPESr0r7FLOAT_NUMPY_DTYPESr9FLOAT_EA_DTYPESr;ALL_FLOAT_DTYPESr=COMPLEX_DTYPESr?COMPLEX_FLOAT_DTYPESrASIGNED_INT_NUMPY_DTYPESrCUNSIGNED_INT_NUMPY_DTYPESrEALL_INT_NUMPY_DTYPESrGALL_INT_EA_DTYPESrIALL_INT_DTYPESrKrMALL_INT_PYARROW_DTYPES_STR_REPRFLOAT_PYARROW_DTYPES_STR_REPRrOSIGNED_INT_EA_DTYPESrQALL_REAL_NUMPY_DTYPESrSALL_REAL_DTYPESrUALL_NUMPY_DTYPESrWALL_REAL_NULLABLE_DTYPESrYALL_NUMERIC_DTYPESr[rd_any_skipna_inferred_dtyper{_rirtr__all__rrrsetitemlocilocrrrratriatrrrrrwarsawsrrror4r2rEs.)&#"""""  ''''''  .-----)))))))))                             ('''''  KK KKK He%HHHIIII$9<9<9<9>>           V=2=#=#=>>>       e}%%%&%:::;;;<; K011121r,F,FGGGHGbfbf-.../.-r(.H.HIIIJI! 6*+++,+vWh,?@@@  A@ #vrx06R6R6RSSSTSvy"(;AUAUVVVWV!    0"    (( ee77EE#JJ777vFFF( ee77EE#JJ777uEEE( <555(::lCLIII (  ll<3??? ( w#FFF ( ZZ__( EE)")C.. / / /( UU929S>> 1 1 1( UU929S>> 1 1 1( UU929S>> 1 1 1( UU929S>> 1 1 1( eeIBIcNN(333( eeIBIcNN(333( eeIBIcNN(333( uuYRYs^^9555!("uuYRYs^^9555#(($55$*&999%(&%%u )666'(( #[)))D929S 3T3T3T,TT)(.%% #\***TIBIc4V4V4V-VV/(4##DDLL2$5665(6) )+"+a#*F*F*FGG7(8 UU2YY9(: $j$SS)>)>)> %J%JKK;(<88::=(>   ! !?(@uu'''((A(BEE)")C..888C(DUU929S>>:::E(FeeIBIcNN)<<>0066iHHHI(JUU44s444&>???     25 i'}r}Y/G/GHHH i(  i0H0HIII 26            YmbmI&>&>???    !0r'''('r'((()( 25 i'}r}Y/G/GHHH i(  i0H0HIII 26      11! 1$r+,,,-,r,---.-r,---.-r)***+*r*+++  ,+ r()))*)r.///  0/ r1222  32 r3444  54 r.///0/"r+,,,  -,  r()))*)2r+b.@@AAABA*  ( ) & '   :r.///  0/ r/00010(r)***+*,r*+++!!,+!Hr233343>r,---.-FRVS!" RUC ! sBFC ! tRVT"# rvrvrv&' bMsBFA&' sBFC !#rvs#$BFAQ,-RVWWQZZ01rvu%&rue$%MBM,//|9T9TUV))J'':1F1FGH dd4AT1a(8(8 9:()99Q<<167 dd1ggrvttAww '( t bfffTll34((1a.."&((1a..9:36 ( )Q1s;;;,","<;,"d&&&$HHHIII66JI6  #   kk*+++,+!,    ru       BFBG455565()))*) BG,---.- BF+,,,-,rv'''('()))*)DDDD2222 4 5  NN$8$_55666w (((((s$1B99CC C C+*C+