o
    _~#g                     @  s   d dl mZ d dlmZ d dlZd dlZd dlZd dlmZ d dl	m
Z
 d dlmZmZ d dlmZ d dlZd dlmZmZmZmZmZmZmZmZmZmZmZmZ d dlmZ  d dl!m"  m#Z$ d d	l%m&Z& G d
d dZ'G dd dZ(dS )    )annotations)datetimeN)using_pyarrow_string_dtype)	Timestamp)is_integer_dtypeis_numeric_dtype)CategoricalDtype)CategoricalIndexDatetimeIndexDatetimeTZDtypeIndexIntervalIndex
MultiIndexPeriodIndex
RangeIndexSeriesTimedeltaIndexisnaperiod_range)BaseMaskedArrayc                   @  s   e Zd Zejeddddeejdej	deejdej
deejdejdeedddejdeedddejdeedddejdeedddejdeedeg ded	dd
deg ddd
deg ddd
dejedddgddd Zdd Zdd Zdd Zdd Zdd  Zd!d" Zd#d$ Zd%d& Zej !d'd(d) Z"d*d+ Z#d,d- Z$d.d/ Z%d0d1 Z&d2d3 Z'd4d5 Z(d6d7 Z)ej j*e+ d8d9d:d; Z,d<d= Z-ej !d'd>d? Z.d@dA Z/dBdC Z0dDdE Z1dFdG Z2dHdI Z3dJdK Z4dLdM Z5dNdO Z6ej 7dPdQdR dSdR gej !d'dTdU Z8dVdW Z9ej 7dXdYdZgej 7d[d\d]gej 7d^dYdZgd_d` Z:dadb Z;ej j<dcdd Z=dedf Z>dgdh Z?didj Z@dkdl ZAdmdn ZBdodp ZCdqdr ZDdsdt ZEdudv ZFdwdx ZGdydz ZHd{d| ZId}d~ ZJdd ZKd\S )TestBaser         startstopstep   dtypeabcde)r   a   br   c20130101D)periodsfreq)z0 days 01:00:00z1 days 01:00:00z2 days 01:00:00z3 days 01:00:00z4 days 01:00:00ztimedelta64[ns])r   r(   )z
2013-01-01z
2013-01-02z
2013-01-03z
2013-01-04z
2013-01-05zdatetime64[ns]   right)closedparamsc                 C     |j S Nparamselfrequest r5   /var/www/static.ux5.de/https/Moving-Object-Detection-with-OpenCV/env/lib/python3.10/site-packages/pandas/tests/indexes/test_old_base.pysimple_index(   s   !zTestBase.simple_indexc                 C  s`   t |tr
td dg d}tjt|d t|  W d    d S 1 s)w   Y  d S )Nz#RangeIndex() is a valid constructor|)zNIndex\(\.\.\.\) must be called with a collection of some kind, None was passedzPDatetimeIndex\(\) must be called with a collection of some kind, None was passedzQTimedeltaIndex\(\) must be called with a collection of some kind, None was passedz:__new__\(\) missing 1 required positional argument: 'data'z2__new__\(\) takes at least 2 arguments \(1 given\)match)
isinstancer   pytestskipjoinraises	TypeErrortype)r3   r7   msgr5   r5   r6   test_pickle_compat_constructionK   s   

"z(TestBase.test_pickle_compat_constructionc                 C  s   t |tttfrtd |}dt|j }tjt	|d |
d W d    n1 s.w   Y  tjt	|d |
dd W d    d S 1 sLw   Y  d S )Nz"Tested in test_ops/test_arithmeticz\This method is only implemented for DatetimeIndex, PeriodIndex and TimedeltaIndex; Got type r9   r"   r   )r;   r
   r   r   r<   r=   rA   __name__r?   NotImplementedErrorshiftr3   r7   idxrB   r5   r5   r6   
test_shift^   s   
"zTestBase.test_shiftc                 C  sH   |}t jtdd t||g d W d    d S 1 sw   Y  d S )Nz"Index.name must be a hashable typer9   name)r<   r?   r@   rA   r3   r7   rH   r5   r5   r6    test_constructor_name_unhashablel   s   "z)TestBase.test_constructor_name_unhashablec                 C  s   |  }t|ts'd|_t|}t|| t|dd}d|_t|| d S ddg|_t|}t|ttg dddddgd t|dd	gd}t|ttg ddddd	gd d S )
NfoobarrJ   ))rN   one)rN   two)rO   rP   )bazrQ   )quxrP   )rS   rQ   objectr   )namesAB)copyr;   r   rK   r   tmassert_index_equalrU   )r3   r7   expectedresultr5   r5   r6   test_create_index_existing_names   s>   

z(TestBase.test_create_index_existing_namec           	      C  s   |}t |tr	J t|tu rtd t|jst |tr#td t|j	j
}t|j
}dd| dd| d| dg}tjt|d |d	  W d    n1 sVw   Y  dd
| dd| d| dg}tjt|d d	|  W d    n1 sw   Y  |dd}tjt|d |d	  W d    n1 sw   Y  |dd}tjt|d d	|  W d    n1 sw   Y  |dd}tjt|d |d	  W d    n1 sw   Y  |dd}tjt|d d	|  W d    d S 1 s	w   Y  d S )NzNot applicable for IndexTested elsewhere.r8   z'unsupported operand type\(s\) for \*: 'z' and 'int'zIcannot perform (__mul__|__truediv__|__floordiv__) with this index type: ()r9   r"   z1unsupported operand type\(s\) for \*: 'int' and ''zLcannot perform (__rmul__|__rtruediv__|__rfloordiv__) with this index type: (*/z//)r;   r   rA   r   r<   r=   r   r   r   _datarD   r>   r?   r@   replace)	r3   r7   rH   typclslmsgrmsgdiv_errfloordiv_errr5   r5   r6   test_numeric_compat   sd   










$zTestBase.test_numeric_compatc                 C  s  |j tdfv rtd |}|j jdv rD| |j ksJ | |  ks+J | |j ks6J | |  ksBJ d S d}t	|t
rMd}tjt|d |  W d    n1 scw   Y  tjt|d |  W d    d S 1 sw   Y  d S )Nstringr^   iufcbmzcannot perform (any|all)zP'IntervalArray' with dtype interval\[.*\] does not support reduction '(any|all)'r9   )r   rT   r<   r=   kindall_values	to_seriesanyr;   r   r?   r@   rG   r5   r5   r6   test_logical_compat   s$   



"zTestBase.test_logical_compatc                 C  s<   t |trtdt|j  |}ttt	|| d S )NNot a valid repr for )
r;   r   r<   r=   rA   rD   rY   rZ   evalreprrL   r5   r5   r6   test_repr_roundtrip   s   
zTestBase.test_repr_roundtripc                 C  sx   t |trtdt|j  |}|d}tdd  t	| dt
|vs*J W d    d S 1 s5w   Y  d S )Nrt   2   zdisplay.max_seq_itemsz...)r;   r   r<   r=   rA   rD   repeatpdoption_contextrv   strrL   r5   r5   r6   test_repr_max_seq_item_setting   s   

"z'TestBase.test_repr_max_seq_item_settingz3ignore:PeriodDtype\[B\] is deprecated:FutureWarningc                 C  s|  i }t |tr|j|d< nt |tttfrtd n|jt	kr*|j
dkr*|j|d< t|}||jfddi|}t |jtrH|d|j}t |ttfrT|d }t|| t |trd}tjt|d	 |d|jd
d|}W d    n1 s~w   Y  tj|j|jdd d S t |trd S t|tu r't |jtjs'||jfdd
i|}t|| t |jtrt|jj |jj sJ tj|jj |jj dd t|jj!|jj!sJ tj|jj!|jj!dd d S |jdkrt|jj"|jj"sJ tj|jj"|jj"dd d S |jdv r"t|j|js J d S t#|j||jfdd
i|}tj|j|jdd d S )Nr(   zaRangeIndex cannot be initialized from data, MultiIndex and CategoricalIndex are tested separatelybooleanr   rX   TUTCz2The 'ordinal' keyword in PeriodIndex is deprecatedr9   F)ordinalrX   same)
check_samezstring[python])zstring[pyarrow]zstring[pyarrow_numpy]r5   )$r;   r   r(   r   r   r	   r<   r=   r   rT   inferred_typerA   valuesr   tz_localize
tz_converttzr
   r   
_with_freqrY   rZ   assert_produces_warningFutureWarningasi8assert_numpy_array_equalr   r   nprp   r   shares_memoryrc   _mask_ndarrayrE   )r3   indexinit_kwargs
index_typer\   depr_msgr5   r5   r6   test_ensure_copied_data   s\   







z TestBase.test_ensure_copied_datac                 C  s   |j   | }|jr|dksJ d S ||d  | }|jdd}t|ttfs?t|t	u r9t|j
tj
r?||ks?J |jdkrJ||ksLJ d S d S )Nr   TdeeprT   )_engineclear_mappingmemory_usageemptyget_locr;   r   r   rA   r   r   r   r   )r3   r   r\   result2result3r5   r5   r6   test_memory_usage7  s   

zTestBase.test_memory_usagec                 C  sJ   t |trtt| j d | }t| }t	j
||dd d S )Nz separately testedF)check_dtype)r;   r	   r<   r=   rA   rD   argsortr   arrayrY   r   )r3   r   r\   r[   r5   r5   r6   test_argsortO  s
   
zTestBase.test_argsortc                 C  s   t |}| }t|| t j|dd}|jdd}t|| t|ttfrld}tjt	|d t j|dd W d    n1 sDw   Y  d}tjt	|d t j|dd	 W d    d S 1 sew   Y  d S d S )
N	mergesort)rn   %the 'axis' parameter is not supportedr9   r"   axisz&the 'order' parameter is not supported)r!   r#   )order)
r   r   rY   r   r;   r	   r   r<   r?   
ValueError)r3   r   r\   r[   rB   r5   r5   r6   test_numpy_argsortW  s    
	"zTestBase.test_numpy_argsortc                 C  sx   d}|  }|j}||j||jd}t||| |}tt	|}||j||jd}t||| d S )Nr   rJ   )
rX   _constructorr   ry   rK   rY   rZ   r   arangelen)r3   r7   reprH   new_index_clsr[   r5   r5   r6   test_repeatp  s   zTestBase.test_repeatc                 C  sn   d}|}| |}tt ||| d}tjt|d tj ||dd W d    d S 1 s0w   Y  d S )Nr   r   r9   r   r   )ry   rY   rZ   r   r<   r?   r   )r3   r7   r   rH   r[   rB   r5   r5   r6   test_numpy_repeat|  s   
"zTestBase.test_numpy_repeatc                 C  s   t |ttfst|jrtd |}|}t |ttfr!|	d }dgt
| }|||}|}t|| dgdgt
|dd    }t|jg|dd    |jd}|||}t|| d S )Nr^   TFr"   r   )r;   r   r   r   r   r<   r=   r
   r   r   r   whererY   rZ   r   	_na_valuetolist)r3   listlike_boxr7   klassrH   condr\   r[   r5   r5   r6   
test_where  s    

"zTestBase.test_wherec                 C  s   |dd }t |std d }|jtkr|jdkrt}d}tj||d |	d|d }W d    n1 s9w   Y  |dd 
|sIJ d S )Nr"      Not applicable for empty indexr~   z<The behavior of Index.insert with object-dtype is deprecatedr9   r   )r   r<   r=   r   rT   r   r   rY   r   insertequals)r3   r   trimmedwarnrB   r\   r5   r5   r6   test_insert_base  s   
zTestBase.test_insert_basez.completely different behavior, tested elsewher)reasonc                 C  s   t |dkr	t}nt}t |dkrd}nd}tj||d |dd W d    n1 s.w   Y  ddd	g}tjt|d |t |d
 d
 W d    n1 sVw   Y  tjt|d |t | d
 d
 W d    d S 1 syw   Y  d S )Nr   z5index (0|0.5) is out of bounds for axis 0 with size 0zBslice indices must be integers or None or have an __index__ methodr9   g      ?rN   r8   z5index -?\d+ is out of bounds for axis 0 with size \d+zloc must be an integer betweenr"   )r   r@   
IndexErrorr<   r?   r   r>   )r3   r   errrB   r5   r5   r6   test_insert_out_of_bounds  s(   "z"TestBase.test_insert_out_of_boundsc                 C  s   t |s	td t|trtt| j d |dd  }|d}||s+J |j	|j	ks3J |d d }|d}||sEJ |j	|j	ksMJ t |}d| d| }tj
t|d || W d    d S 1 sqw   Y  d S )	Nr    tested elsewherer"   r   zindex z' is out of bounds for axis 0 with size r9   )r   r<   r=   r;   r   rA   rD   deleter   rK   r?   r   )r3   r   r[   r\   lengthrB   r5   r5   r6   test_delete_base  s"   



"zTestBase.test_delete_basec                 C  s   t |trtt|j d t|tu ot |jtj }|	|s%J |	|
 s.J |s:|	|ts:J |	t|rCJ |	t|rMJ t |tsh|sht|td}|	|saJ |	|shJ |jdkrv|	t|rxJ d S d S )Nr   r   r"   )r;   r   r<   r=   rA   rD   r   r   r   r   rX   astyperT   listr   r   nlevelsr   )r3   r   	is_ea_idxsame_valuesr5   r5   r6   test_equals  s"   

zTestBase.test_equalsc                 C  sX  |}t |}|dd }|dd |dd }|dd }d}tjt|d ||k W d    n1 s7w   Y  tdg| }tdg|d  dg }	t||k| t||k|	 t|}
t|dd }t|dd |dd }t|dd }tjt|d ||k W d    n1 sw   Y  t||
k| t||k|	 t	|
}t	|}t	|}t	|}tjt|d ||k W d    n1 sw   Y  t||k| t||k|	 tjtd	d ||k W d    n	1 sw   Y  tjtd	d ||k W d    n	1 s!w   Y  tjtd	d ||k W d    n	1 s=w   Y  d
}tjt|d ||k W d    n	1 s[w   Y  tjtd	d ||k W d    n	1 sww   Y  t
|tstdgt |d  ddg }|d }t||k| t||kt	| d S d S )Nr   r   r"   z)Lengths must match|could not be broadcastr9   TFzLengths must matchz3Can only compare identically-labeled Series objectsr   )r   appendr<   r?   r   r   r   rY   r   r   r;   r   assert_series_equal)r3   r7   index_anindex_bindex_cindex_drB   	expected1	expected2array_aarray_barray_carray_dseries_aseries_bseries_cseries_d	expected3itemr5   r5   r6   test_equals_op  sj   

 






 zTestBase.test_equals_opc                 C  sx   t |js
t|trtd |}dd |D }d}tjt|d |	 |ks*J W d    d S 1 s5w   Y  d S )Nr^   c                 S     g | ]}t |qS r5   r|   .0xr5   r5   r6   
<listcomp>A      z(TestBase.test_format.<locals>.<listcomp>Index\.format is deprecatedr9   )
r   r   r;   r
   r<   r=   rY   r   r   formatr3   r7   rH   r[   rB   r5   r5   r6   test_format:  s   
"zTestBase.test_formatc                 C  s   t |ttfrtd t|g }d}tjt|d |	 g ks$J W d    n1 s.w   Y  tjt|d |j	dddgksFJ W d    d S 1 sQw   Y  d S )NTested elsewherer   r9   TrJ    )
r;   r   r   r<   r=   rA   rY   r   r   r   )r3   r7   	empty_idxrB   r5   r5   r6   test_format_emptyF  s   
"zTestBase.test_format_emptyc              	   C  s  t |dkrtd d S |jtkrt|j d d S t|tr2t|jr2td|j  d S t|tr`|j	dd}d}tj
t|d ||d  W d    d S 1 sYw   Y  d S |j	dd}||d }t|| ||usyJ d	}tj
t|d ||d g W d    n1 sw   Y  |j	dd}|j}tj|d
< t||}d}d}tjt|d( tj
t|d |j|d dd W d    n1 sw   Y  W d    n1 sw   Y  tjdgt | td}d|d
< t|j| |jdu sJ d S )Nr   zNot relevant for empty indexz cannot hold NAszNot relevant for Index with Tr   "isna is not defined for MultiIndexr9   z"'value' must be a scalar, passed: r"   zdoes not support 'downcast'z7The 'downcast' keyword in .*Index\.fillna is deprecatedinfer)downcastFr   )r   r<   r=   r   boolr;   r   r   r   rX   r?   rE   fillnarY   rZ   r@   rp   r   nanrA   r   r   r   r   _isnanhasnans)r3   r   rH   rB   r\   r   msg2r[   r5   r5   r6   test_fillnaQ  sH   

"
zTestBase.test_fillnac                 C  s   t |dkrt| tjg td d S t|tr>|	 }d}t
jt|d |  W d    d S 1 s7w   Y  d S |jsat| tjt |td t| tjt |td d S t|}t| | t| |  d S )Nr   r   r   r9   )r   rY   r   r   r   r   r   r;   r   rX   r<   r?   rE   r   zerosnotnaones)r3   r   rH   rB   r\   r5   r5   r6   
test_nulls{  s   

""zTestBase.test_nullsc                 C  s$   |}|j rJ |d d j sJ d S Nr   )r   rL   r5   r5   r6   
test_empty  s   
zTestBase.test_emptyc                 C  sB   |}|j r|j||d}|}|dkrt|}t|| d S d S )N)howouter)	is_uniquer>   algos	safe_sortrY   rZ   )r3   	join_typer7   rH   joinedr[   r5   r5   r6   test_join_self_unique  s   
zTestBase.test_join_self_uniquec                 C  s>   t |ttfrtd |}|dd }tj||dd d S )Nr^   c                 S  s   | S r/   r5   )r   r5   r5   r6   <lambda>  s    z#TestBase.test_map.<locals>.<lambda>equivexact)r;   r   r   r<   r=   maprY   rZ   )r3   r7   rH   r\   r5   r5   r6   test_map  s
   
zTestBase.test_mapmapperc                 C  s   dd t | |D S )Nc                 S  s   i | ]\}}||qS r5   r5   )r   eir5   r5   r6   
<dictcomp>  s    z%TestBase.<lambda>.<locals>.<dictcomp>)zipr   r   r5   r5   r6   r    r   zTestBase.<lambda>c                 C  s
   t | |S r/   )r   r  r5   r5   r6   r    s   
 c           	      C  s   |}t |tttfrtd ||j|}||}tj	||dd d }|j
jdkr-|j
}ttjgt| |d}||||}t	|| d S )Nr^   r  r  fr   )r;   r
   r   r   r<   r=   r   r  rY   rZ   r   rn   r   r   r   r   )	r3   r  r7   r4   rH   identityr\   r   r[   r5   r5   r6   test_map_dictlike  s   	

zTestBase.test_map_dictlikec                 C  sD   t |tr
td |}|t}tdd |D }t|| d S )NzSee test_map.pyc                 S  r   r5   r   r   r5   r5   r6   r     r   z)TestBase.test_map_str.<locals>.<listcomp>)	r;   r	   r<   r=   r  r|   r   rY   rZ   )r3   r7   rH   r\   r[   r5   r5   r6   test_map_str  s   


zTestBase.test_map_strrX   TFrK   NrN   orderedc           	      C  s   |}|r	| |}t|d}|j||d}t|||d}tj||dd t|  d d |}|j||d}t|||d}tj||dd |du rb|jd	|d}t||d
}tj||dd d S d S )N)r  )rX   )rK   r  Tr  r   )rK   r   FcategoryrJ   )renamer   r   r	   rY   rZ   uniquer   )	r3   rX   rK   r  r7   rH   r   r\   r[   r5   r5   r6   test_astype_category  s    

zTestBase.test_astype_categoryc                 C  s   |  }|jdu sJ |d d }|jdu sJ |d|d }|jdu s'J |dtj}|jdu s5J |dtj}|jdu sCJ d S )NTr   F)drop_duplicatesr  r   r   r   )r3   r7   r   index_empty	index_dupindex_naindex_na_dupr5   r5   r6   test_is_unique  s   zTestBase.test_is_uniquec                 C  s,   |  }t|}|j ~| d u sJ d S r/   )rX   weakrefrefr   )r3   r7   r   r'  r5   r5   r6   test_engine_reference_cycle  s
   
z$TestBase.test_engine_reference_cyclec                 C  sX  t |tr
td |}d}tjttf|d |d d d f  W d    n1 s*w   Y  t |tsqtjttf|d |d  W d    n1 sLw   Y  tjttf|d |d  W d    d S 1 sjw   Y  d S d}tjt|d |d  W d    n1 sw   Y  tjt|d |d  W d    d S 1 sw   Y  d S )Nr   z(Multi-dimensional indexing|too many|onlyr9   TFzonly integers, slices)r;   r   r<   r=   r?   r   r   r   rG   r5   r5   r6   test_getitem_2d_deprecated  s*   




"

"z#TestBase.test_getitem_2d_deprecatedc                 C  s.   |}| |d  | }|j|ju sJ d S r  )r   rX   _cache)r3   r7   rH   rX   r5   r5   r6   test_copy_shares_cache  s   zTestBase.test_copy_shares_cachec                 C  sX   |}| |d  | }|j|ju sJ ||j}|j|jus#J |ji ks*J d S r  )r   _viewr*  _shallow_copyrc   )r3   r7   rH   shallow_copyr5   r5   r6   test_shallow_copy_shares_cache"  s   z'TestBase.test_shallow_copy_shares_cachec              	   C  s   |d d }t ddt jddg}t|||ddg |ddg d ttdd	dtdd
dtj	tdd
dtdd	dgddj
}tdtdg}|d |ddg |d |ddg i}t||| d S )Nr   r"   r   r   r      )g      ?g       @i  r)      r   )r   z
2011-11-01z
2011-12-01)r   r   r   rY   assert_dict_equalgroupbyr
   r   rz   NaTr   r   )r3   r7   rH   
to_groupbyex_keysr[   r5   r5   r6   test_index_groupby.  s&    



	$zTestBase.test_index_groupbyc                 C  s   |}t |}||}|j|jksJ tj|d | |dd tj||d  |dd |tt|d }tj||dd d S )NT)check_exactr   )r   r   r   rY   rZ   taker   range)r3   r7   r   Nr\   altr5   r5   r6   test_append_preserves_dtypeD  s   
z$TestBase.test_append_preserves_dtypec           
      C  s  |}|j jdv r)| }t|j |jd}t|| t| }t|t| d S |j jdkr4t	}d}n|rF|j dkrFdd l
}	|	jj}d}nt	}d}tj||d	 |  W d    n1 s_w   Y  tj||d	 t|  W d    d S 1 s|w   Y  d S )
N)r  urJ   r  z0ufunc 'invert' not supported for the input typesrl   r   zhas no kernelzbad operandr9   )r   rn   r   r   rK   rY   rZ   r   r   r@   pyarrowlibArrowNotImplementedErrorr<   r?   )
r3   r7   using_infer_stringrH   resr[   res2r   rB   par5   r5   r6   test_invQ  s,   
"zTestBase.test_invc                 C  <   |}t t |  W d    d S 1 sw   Y  d S r/   )rY   r   r   
is_booleanrL   r5   r5   r6   test_is_boolean_is_deprecatedo     
"z&TestBase.test_is_boolean_is_deprecatedc                 C  rG  r/   )rY   r   r   is_floatingrL   r5   r5   r6   test_is_floating_is_deprecatedu  rJ  z'TestBase.test_is_floating_is_deprecatedc                 C  rG  r/   )rY   r   r   
is_integerrL   r5   r5   r6   test_is_integer_is_deprecated{  rJ  z&TestBase.test_is_integer_is_deprecatedc                 C  sP   |}t |j d}tjt|d |  W d    d S 1 s!w   Y  d S )Nz.holds_integer is deprecated. r9   )rA   rD   rY   r   r   holds_integerrG   r5   r5   r6   test_holds_integer_deprecated  s
   
"z&TestBase.test_holds_integer_deprecatedc                 C  sL   |}t jtt|j dd |  W d    d S 1 sw   Y  d S )Nz.is_numeric is deprecated. r9   )rY   r   r   rA   rD   
is_numericrL   r5   r5   r6   test_is_numeric_is_deprecated  s   
"z&TestBase.test_is_numeric_is_deprecatedc                 C  s@   |}t jtdd |  W d    d S 1 sw   Y  d S )Nz4Use pandas\.api\.types\.is_categorical_dtype insteadr9   )rY   r   r   is_categoricalrL   r5   r5   r6   !test_is_categorical_is_deprecated  s   
"z*TestBase.test_is_categorical_is_deprecatedc                 C  rG  r/   )rY   r   r   is_intervalrL   r5   r5   r6   test_is_interval_is_deprecated  rJ  z'TestBase.test_is_interval_is_deprecatedc                 C  rG  r/   )rY   r   r   	is_objectrL   r5   r5   r6   test_is_object_is_deprecated  rJ  z%TestBase.test_is_object_is_deprecated)LrD   
__module____qualname__r<   fixturer   r   r   r   float64float32uint64r:  int64int32int16int8r   r   r   r
   r   from_breaksr7   rC   rI   rM   r]   rk   rs   rw   r}   markfilterwarningsr   r   r   r   r   r   r   r   skipifr   r   r   r   r   r   r   r   r   r  r
  r  parametrizer  r  r  r%  arm_slowr(  r)  r+  r/  r7  r=  rF  rI  rL  rN  rP  rR  rT  rV  rX  r5   r5   r5   r6   r   '   s    


 4/


;



>*	

	
		r   c                   @  s  e Zd Zejeddddeejdej	deejdej
deejdejdeedddejdeedddejdeedddejdeedddejdgddd	 Zd
d Zdd Zdd Zdd Zdd Zdd Zdd Zejdejejgdd Zdd ZdS )TestNumericBaser   r   r   r   r   r   r,   c                 C  r.   r/   r0   r2   r5   r5   r6   r7     s   zTestNumericBase.simple_indexc                 C  s`   t |tr
td t|}|j}tddg|d}||}tjddg|jd}t	
|j| d S )Nr^   r"   r   r   )r;   r   r<   r=   rA   r   r   r   r   rY   r   rc   )r3   r7   	index_clsr   rH   r\   r[   r5   r5   r6   test_constructor_unwraps_index  s   

z.TestNumericBase.test_constructor_unwraps_indexc                 C  s"   |}|d }| |du sJ d S )Nr   F)$_can_hold_identifiers_and_holds_name)r3   r7   rH   keyr5   r5   r6   test_can_hold_identifiers  s   z)TestNumericBase.test_can_hold_identifiersc                 C  s   t |tr
td t|}|j}|g |dd}| }|jdks#J ||}tj	|||dddd d}tj
t|d ||}W d    n1 sMw   Y  tj	|||dddd d S )	Nr^   Foo)r   rK   rJ   Tr  z,Passing a type in .*Index.view is deprecatedr9   )r;   r   r<   r=   rA   r   viewrK   rY   rZ   r   r   )r3   r7   rj  r   rH   idx_viewrB   r5   r5   r6   	test_view  s   


zTestNumericBase.test_viewc                   s   t |tr
td |}tdd |D   fdd|D }d}tjt|d | |ks0J W d    d S 1 s;w   Y  d S )Nr   c                 s  s    | ]	}t t|V  qd S r/   )r   r|   r   r5   r5   r6   	<genexpr>  s    z.TestNumericBase.test_format.<locals>.<genexpr>c                   s   g | ]	}t | qS r5   )r|   ljustr   	max_widthr5   r6   r     s    z/TestNumericBase.test_format.<locals>.<listcomp>r   r9   )	r;   r
   r<   r=   maxrY   r   r   r   r   r5   ru  r6   r     s   

"zTestNumericBase.test_formatc                 C  sD   |}| d|d }t|d gt| |jd}tj||dd d S )Nr   r   Tr  )r   r   r   r   rY   rZ   )r3   r7   r   r\   r[   r5   r5   r6   test_insert_non_na  s   z"TestNumericBase.test_insert_non_nac                 C  s   |}|}|t ju rt|d t jgt|dd   td}nt|d tjgt|dd   }|jjdkr;t||jd}|	d|}t
j||dd d S )Nr   r"   r   r  Tr  )rz   r4  r   r   rT   r   r   r   rn   r   rY   rZ   )r3   nulls_fixturer7   r   na_valr[   r\   r5   r5   r6   test_insert_na  s   
("zTestNumericBase.test_insert_nac           	      C  s   t |}|tu rtd}n	|tjddd}tjdddd }t|tjd}|d }t|| d| }t|| t|tjd}tjddd}|| }t|| t| tjd}tjddd}|| }t|| d S )Nr   r_  r   g	@r\  )	rA   r   r   r   r   r\  rY   rZ   r   )	r3   r7   rj  rH   arrr[   fidxr!   r\   r5   r5   r6   $test_arithmetic_explicit_conversions  s$   
z4TestNumericBase.test_arithmetic_explicit_conversionscomplex_dtypec                 C  s(   | |}t|tu r|j|ksJ d S r/   )r   rA   r   r   )r3   r  r7   r\   r5   r5   r6   test_astype_to_complex  s   
z&TestNumericBase.test_astype_to_complexc                 C  sP   t |tr
td t|g d|jd}t|g d|jd}t|| d S )Nz.casting of strings not relevant for RangeIndex)012r   )r   r"   r   )r;   r   r<   r=   rA   r   rY   rZ   )r3   r7   r\   r[   r5   r5   r6   test_cast_string   s
   

z TestNumericBase.test_cast_stringN)rD   rY  rZ  r<   r[  r   r   r   r   r\  r]  r^  r:  r_  r`  ra  rb  r7   rk  rn  rr  r   rx  r{  r~  rd  rg  	complex64
complex128r  r  r5   r5   r5   r6   ri    s.    


ri  ))
__future__r   r   r&  numpyr   r<   pandas._configr   pandas._libs.tslibsr   pandas.core.dtypes.commonr   r   pandas.core.dtypes.dtypesr   pandasrz   r	   r
   r   r   r   r   r   r   r   r   r   r   pandas._testing_testingrY   pandas.core.algorithmscore
algorithmsr  pandas.core.arraysr   r   ri  r5   r5   r5   r6   <module>   s.    8       