B @`w @sXddlZddlZddlZddlmZmZmZmZddl m Z ddZ ej dejdejdgddd Zd d ejejejgDZed d ejejgDed d ejejejgDeejdejdgedddgej edddZej eejdddeejdddeejdddedgdddddZej edededgdddddZej ejdejd ejdd!ed"e dd#e d d$gd%ddd&d'Z!ej ejd(ej"d)ejd(d*ejd+d,e d(d$e d)d-gd.ddd/d0Z#ej$d(ej%dej"gZ&ej ejd1d2e d1d3ejd1d,ge&dd4d5Z'ej e d6d$ejd7d*ed8ge&dd9d:Z(ej e d;d#ejd;d!ejd;d!ge&ddd?Z,ej ejej*e j-eje.ge dd@dAZ/e,Z0dS)BN) Float64Index Int64Index RangeIndex UInt64IndexcCs>t|tr4t|dkst|djdt|dS|jSdS)Nr-) isinstancetuplelenAssertionError__name__str)xrD/tmp/pip-unpacked-wheel-q9tj5l6a/pandas/tests/arithmetic/conftest.pyid_func s rr)dtype)paramscCs|jS)aL Several variants of integer value 1. The zero-dim integer array behaves like an integer. This fixture can be used to check that datetimelike indexes handle addition and subtraction of integers and zero-dimensional arrays of integers. Examples -------- >>> dti = pd.date_range('2016-01-01', periods=2, freq='H') >>> dti DatetimeIndex(['2016-01-01 00:00:00', '2016-01-01 01:00:00'], dtype='datetime64[ns]', freq='H') >>> dti + one DatetimeIndex(['2016-01-01 01:00:00', '2016-01-01 02:00:00'], dtype='datetime64[ns]', freq='H') )param)requestrrronesrcCs4g|],}tjtjtjgD]}|dgd|dqqS)r)r)npint64uint64float64).0box_clsrrrr /srcCs g|]}|dgdtjdqS)gr)r)rr)rrrrrr4scCsg|]}tjd|dqS)r)r)rarray)rrrrrr6sggcCs|jS)a Several types of scalar zeros and length 5 vectors of zeros. This fixture can be used to check that numeric-dtype indexes handle division by any zero numeric-dtype. Uses vector of length 5 for broadcasting with `numeric_idx` fixture, which creates numeric-dtype vectors also of length 5. Examples -------- >>> arr = RangeIndex(5) >>> arr / zeros Float64Index([nan, inf, inf, inf, inf], dtype='float64') )r)rrrrzero;sr!rrrrcCs t|jS)N)typer )rrrrZr#)ridscCs|jS)z7 Several types of numeric-dtypes Index objects )r)rrrr numeric_idxSs r&Z5m4scCs t|jS)N)r"r )rrrrr#mr$cCs|jS)zT Several variants of Timedelta scalars representing 5 minutes and 4 seconds )r)rrrr scalar_tdgs r'H)daysz72:00:00DhcCs t|jS)N)r"r )rrrrr#r$cCs|jS)za Several timedelta-like and DateOffset objects that each represent a 3-day timedelta )r)rrrr three_daysvsr-rx)hoursi )secondsmcCs t|jS)N)r"r )rrrrr#r$cCs|jS)zb Several timedelta-like and DateOffset objects that each represent a 2-hour timedelta )r)rrrr two_hourssr2)minutesscCs|jS)zp Several timedelta-like and DateOffset instances that are _not_ compatible with Hourly frequencies. )r)rrrr not_hourlys r6z23:00:00cCs|jS)zo Several timedelta-like and DateOffset instances that are _not_ compatible with Daily frequencies. )r)rrrr not_dailys r9imcCs|jS)z{ Several timedelta-like and DateOffset instances that are _not_ compatible with Monthly or Annual frequencies. )r)rrrrmismatched_freqs r:cCs|jS)z] Fixture to test behavior for Index, Series, DataFrame, and pandas Array classes )r)rrrrbox_with_arraysr;cCs|jS)zc Fixture to test behavior for Index, Series, tm.to_array, numpy Array and list classes )r)rrrr box_1d_arraysr<)1ZnumpyrZpytestZpandaspdrrrrZpandas._testingZ_testingtmrZfixturer rrZIndexzerosextendrrr!Zaranger&Z TimedeltaZto_pytimedeltaZto_timedelta64r'offsetsZDayZHourZ timedelta64r-ZMinuter2Z YearBeginZ MonthBeginZ_common_mismatchr6r9r:ZSeriesZ DataFramer;Zto_arraylistr<Zbox_with_array2rrrrs|  $                          & (