HOME


sh-3ll 1.0
DIR:/usr/local/lib64/python3.6/site-packages/pandas/tests/reshape/__pycache__/
Upload File :
Current File : //usr/local/lib64/python3.6/site-packages/pandas/tests/reshape/__pycache__/test_util.cpython-36.pyc
3

���h�	�@sHddlZddlZddlmZmZddljZddl	m
Z
Gdd�d�ZdS)�N)�Index�
date_range)�cartesian_productc@sreZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zej	j
dddgdd
gdgd
gddgddgdgdgg�dd��ZdS)�TestCartesianProductcCsjtd�ddg}}t||g�\}}tjddddddg�}tjddddddg�}tj||�tj||�dS)N�ABC���A�B�C)�listr�np�array�tm�assert_numpy_array_equal)�self�x�y�result1�result2�	expected1�	expected2�r�@/tmp/pip-build-5_djhm0z/pandas/pandas/tests/reshape/test_util.py�test_simple
sz TestCartesianProduct.test_simplecCsbtddd�}dd�t||g�D�\}}tddddg�}tddddg�}tj||�tj||�dS)Nz
2000-01-01�)�periodscSsg|]}t|�j�qSr)r�day)�.0rrrr�
<listcomp>sz;TestCartesianProduct.test_datetimeindex.<locals>.<listcomp>r)rrrr�assert_index_equal)rrrrrrrrr�test_datetimeindexsz'TestCartesianProduct.test_datetimeindexcCsFtdddd�}tjddg�}t||g�\}}|jd�}tj||�dS)Nz
2000-01-01rz
US/Pacific)r�tz��)rr
rr�repeatrr )rrrrr�expectedrrr�test_tzaware_retaineds

z*TestCartesianProduct.test_tzaware_retainedcCsLtdddd�jd�}tjddg�}t||g�\}}|jd�}tj||�dS)Nz
2000-01-01rz
US/Pacific)rr"�categoryr#r$)rZastyper
rrr%rr )rrrrrr&rrr�!test_tzaware_retained_categorical$s

z6TestCartesianProduct.test_tzaware_retained_categoricalcCs�gddggg}ggdddgg}xjt||�D]\\}}tjgtj|�jd�}tjgtj|�jd�}t||g�\}}tj||�tj||�q*Wtg�}	g}
|	|
ks�t�dS)Nrr�a�b�c)�dtype)	�zipr
rZasarrayr-rrr�AssertionError)r�X�Yrrrrrr�resultr&rrr�
test_empty,szTestCartesianProduct.test_emptyr0rrr*r+c
Cs,d}tjt|d��t|d�WdQRXdS)Nz'Input must be a list-like of list-likes)�match)r0)�pytestZraises�	TypeErrorr)rr0�msgrrr�test_invalid_input<sz'TestCartesianProduct.test_invalid_inputN)�__name__�
__module__�__qualname__rr!r'r)r3r5�markZparametrizer8rrrrr	s
r)Znumpyr
r5ZpandasrrZpandas._testingZ_testingrZpandas.core.reshape.utilrrrrrr�<module>s