o
    i                     @   sL   d dl Zd dlZd dlmZmZ d dlmZ d dl	m
Z
 dd Zdd ZdS )    N)	DataFrameIndex)
Int64Indexc                  C   s   t jd} tg d| d| dd}dd }dd }|d	||}td
dgdd	d}tj	ddgd|d}t
|| d S )NiI)foobarr   r   r   r   r   r      ABCc                 S   s   | j  | j   S N)r
   maxr   min)dfgb r   Y/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/pandas/tests/groupby/test_pipe.pyf   s   ztest_pipe.<locals>.fc                 S   s   | d S )N   r   )srsr   r   r   square   s   ztest_pipe.<locals>.squarer	   r   r   object)dtypenameg֮vq!@g	֯Y @r
   )r   index)nprandomRandomStater   randngroupbypiper   pdSeriestmassert_series_equal)random_statedfr   r   resultr   expectedr   r   r   	test_pipe   s   r(   c                  C   s   t g dg dg dd} dd }dd }d	d
 }| d|d|d|d}tg ddd}tjg d|d}t|| tg d}||dd }tjg dtg dd}t|| d S )N)r	   r	   r
   r
   r   )g      ?       @g      @r)   g      @)g      $@g      Y@g     @@g      Yg     @)groupxyc                    s   | j  fdddd| jS )Nc                    s   | j   kS r   )r,   meangrparg1r   r   <lambda>:   s    z+test_pipe_args.<locals>.f.<locals>.<lambda>F)dropna)filterr   grouper)r   r1   r   r0   r   r   9   s   ztest_pipe_args.<locals>.fc                 S   sN   d}t jt|d |  |    | W  d    S 1 s w   Y  d S )Nz!The default value of numeric_only)match)r"   assert_produces_warningFutureWarningsum)r   arg2msgr   r   r   g>   s   $ztest_pipe_args.<locals>.gc                 S   s   | j | j | S r   )r+   r,   )r%   arg3r   r   r   hC   s   ztest_pipe_args.<locals>.hr*   r   
   d   r   )r   )g#SgbeSi)r   )   rA   r   r      rB   c                 S   s   |   |   S r   )r9   countr.   r   r   r   r2   P   s    z test_pipe_args.<locals>.<lambda>)   r      )rA   r   rB   )	r   r   r   r   r    r!   r"   r#   r   )r%   r   r<   r>   r&   r   r'   serr   r   r   test_pipe_args-   s"   "rG   )numpyr   pandasr    r   r   pandas._testing_testingr"   pandas.core.apir   r(   rG   r   r   r   r   <module>   s    !