zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
U
­ý°d ã@sjddlZddlZddlZddlmZmZddlmZ    Gdd„dƒZ
Gdd„dƒZ Gdd„dƒZ d    d
„Z dS) éN)ÚIndexÚNaTc@sneZdZej dddg¡dd„ƒZej dddg¡ej d    ed
ƒd d fed ƒddfg¡dd„ƒƒZdd„Z    dS)ÚTestGetSliceBoundszside, expected)Úlefté)ÚrightécCs*ttdƒƒ}|jd|d}||ks&t‚dS)NÚabcdefÚe©Úside)rÚlistÚget_slice_boundÚAssertionError)Úselfr ÚexpectedÚindexÚresult©rúdd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/tests/indexes/base_class/test_indexing.pyÚtest_get_slice_bounds_within s z/TestGetSliceBounds.test_get_slice_bounds_withinr rrzdata, bound, expectedr    ÚxéZbcdefgÚarcCs&t|ƒ}|j||d}||ks"t‚dS)Nr )rrr)rr rÚdataÚboundrrrrrÚtest_get_slice_bounds_outsidesz0TestGetSliceBounds.test_get_slice_bounds_outsidec    Cs0tjtddtgƒjdddW5QRXdS)NzInvalid value for side kwarg©ÚmatchrZmiddler )ÚpytestÚraisesÚ
ValueErrorrr)rrrrÚ"test_get_slice_bounds_invalid_sidesz5TestGetSliceBounds.test_get_slice_bounds_invalid_sideN)
Ú__name__Ú
__module__Ú __qualname__rÚmarkZ parametrizerr rr"rrrrr s
ÿ rc@seZdZdd„ZdS)ÚTestGetIndexerNonUniquecCsTtddgƒ tdgƒ¡\}}t tjdgtjd|¡t tjdgtjd|¡dS)NÚAÚBréÿÿÿÿ©Zdtype)rZget_indexer_non_uniqueÚtmÚassert_numpy_array_equalÚnpÚarrayZintp)rZindexesÚmissingrrrÚ*test_get_indexer_non_unique_dtype_mismatch"szBTestGetIndexerNonUnique.test_get_indexer_non_unique_dtype_mismatchN)r#r$r%r1rrrrr'!sr'c@s$eZdZejjdd„ƒZdd„ZdS)Ú
TestGetLoccCsbtdƒ}tjddd}tj |tdƒ|g¡}| ¡}t|ƒd}||}| |¡}||ks^t    ‚dS)NÚABCDEFGHIJKLMNOPQRSTUVWXYZz
2016-01-01éd)Zperiodsièé)
r ÚpdZ
date_rangeZ
MultiIndexZ from_productÚrangeZ to_flat_indexÚlenÚget_locr)rZlevZdtiÚmiZoidxÚlocÚtupÚresrrrÚ.test_get_loc_tuple_monotonic_above_size_cutoff*s 
z9TestGetLoc.test_get_loc_tuple_monotonic_above_size_cutoffc    Cs†tdtjddddgtd}| tj¡}|dks2t‚| d¡}t ddddddg¡}t ||¡t    j
t dd| t ¡W5QRXdS)    NZfoogð?r+éFTrr) rr.ÚnanÚobjectr9rr/r,r-rr ÚKeyErrorr)rÚidxr=rrrrÚ4test_get_loc_nan_object_dtype_nonmonotonic_nonunique;s  
 z?TestGetLoc.test_get_loc_nan_object_dtype_nonmonotonic_nonuniqueN)r#r$r%rr&Zslowr>rDrrrrr2)s
r2cCs:tjddtjgdd}|j|}tdgƒ}t ||¡dS)NTFÚbooleanr+r)r6ZSeriesZNArrr,Zassert_index_equal)ZserrrrrrÚtest_getitem_boolean_ea_indexerMs
 
rF)Únumpyr.rZpandasr6rrZpandas._testingZ_testingr,rr'r2rFrrrrÚ<module>s $