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
21
22
U
­ý°d  ã@sJddlZddlZddlmZmZddlmZddl    m
Z
Gdd„dƒZ dS)éN)ÚIndexÚ
date_range)Úcartesian_productc @s¬eZdZdd„Zdd„Zdd„Zdd„Zej     d    gggd
d ggggd d dggg¡dd„ƒZ
dd„Z ej     dd d gd dgd gdgd d gd d gd gd gg¡dd„ƒZ dd„Z dS)ÚTestCartesianProductcCsjtdƒddg}}t||gƒ\}}t ddddddg¡}t ddddddg¡}t ||¡t ||¡dS)NÚABCééÚAÚBÚC)ÚlistrÚnpÚarrayÚtmÚassert_numpy_array_equal)ÚselfÚxÚyÚresult1Úresult2Ú    expected1Ú    expected2©rúUd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/tests/reshape/test_util.pyÚ test_simple s  z TestCartesianProduct.test_simplecCsntddd}dd„t||gƒDƒ\}}tddddgtjd}tddddgtjd}t ||¡t ||¡dS)Nú
2000-01-01é)Úperiodscss|]}t|ƒjVqdS©N)rÚday)Ú.0rrrrÚ    <genexpr>sz:TestCartesianProduct.test_datetimeindex.<locals>.<genexpr>r©Údtype)rrrr Úint32rÚassert_index_equal)rrrrrrrrrÚtest_datetimeindexs   z'TestCartesianProduct.test_datetimeindexcCsFtdddd}t ddg¡}t||gƒ\}}| d¡}t ||¡dS)Nrrú
US/Pacific©rÚtzéé)rr rrÚrepeatrr%©rrrrrÚexpectedrrrÚtest_tzaware_retaineds
 
z*TestCartesianProduct.test_tzaware_retainedcCsLtdddd d¡}t ddg¡}t||gƒ\}}| d¡}t ||¡dS)Nrrr'r(Úcategoryr*r+)rZastyper rrr,rr%r-rrrÚ!test_tzaware_retained_categorical's
 
z6TestCartesianProduct.test_tzaware_retained_categoricalzx, yrrÚaÚbÚccCsXtjgt |¡jd}tjgt |¡jd}t||gƒ\}}t ||¡t ||¡dS)Nr")r rZasarrayr#rrr)rrrrrrrrrrÚ
test_empty/s
 zTestCartesianProduct.test_emptycCstgƒ}g}||kst‚dSr)rÚAssertionError)rÚresultr.rrrÚtest_empty_input8sz%TestCartesianProduct.test_empty_inputÚXrc    Cs,d}tjt|dt|dW5QRXdS)Nz'Input must be a list-like of list-likes©Úmatch©r9)ÚpytestÚraisesÚ    TypeErrorr)rr9ÚmsgrrrÚtest_invalid_input>sz'TestCartesianProduct.test_invalid_inputc    CsPd}tjt|d4dd„tdƒDƒtjdtjdg}t|dW5QRXdS)    Nz+Product space too large to allocate arrays!r:cSsg|]}tjddtjd‘qS)rrr")r ÚarangeÚint16)r ÚirrrÚ
<listcomp>LszBTestCartesianProduct.test_exceed_product_space.<locals>.<listcomp>é i;r"r<)r=r>Ú
ValueErrorÚranger rBrCr)rr@ZdimsrrrÚtest_exceed_product_spaceGs ÿz.TestCartesianProduct.test_exceed_product_spaceN)Ú__name__Ú
__module__Ú __qualname__rr&r/r1r=ÚmarkZ parametrizer5r8rArIrrrrr s
(
*ÿ
r) Únumpyr r=ZpandasrrZpandas._testingZ_testingrZpandas.core.reshape.utilrrrrrrÚ<module>s