a
    Gb                     @   s   d dl Zd dlZd dlZd dlmZ ejdgddggddd Z	e dd Z
ejd	dejdd
fdgejdd
gfddgdejdd
gfddgejdd
dgfgdd Zejdddddgdgdgddgddgg dg dg
dd ZdS )    Ninnerouter)paramsc                 C   s>   | j }tg dg dtdg dd}|r:||}|S )Nar   r   br   r            r	   r
   r      oner   twor   r   r   r   r   AB)Zparampd	DataFramenparange	set_index)Zrequestlevelsdf r   Hlib/python3.9/site-packages/pandas/tests/groupby/test_index_as_string.pyframe   s    
r   c                  C   s<   t g dg dtdg dd} | g dd }|S )Nr   r   r   r   r   )r   r   r   r   )r   r   r   r   r   )r   sr   r   r   series   s    r   zkey_strs,grouperslevelr   c                 C   s,   |  | }|  | }t|| d S )N)groupbymeantmZassert_frame_equal)r   Zkey_strsgroupersresultexpectedr   r   r   "test_grouper_index_level_as_string(   s    
r'   r   )r   r   r   )r   r   r   c                 C   sR   t |trdd |D }ntj|d}| | }| | }t|| d S )Nc                 S   s   g | ]}t j|d qS )r   )r   Grouper).0Zlvr   r   r   
<listcomp>J       z=test_grouper_index_level_as_string_series.<locals>.<listcomp>r   )
isinstancelistr   r(   r!   r"   r#   Zassert_series_equal)r   r   r$   r&   r%   r   r   r   )test_grouper_index_level_as_string_series7   s    
r.   )Znumpyr   ZpytestZpandasr   Zpandas._testingZ_testingr#   Zfixturer   r   ZmarkZparametrizer(   r'   r.   r   r   r   r   <module>   s>   

	
