
    d                     F    d Z ddlZddlZddlmZmZ ddlmZmZ d Z	d Z
dS )zY
Test the consistency of the groupby API, both internally and with other pandas objects.
    N)	DataFrameSeries)DataFrameGroupBySeriesGroupByc                    |dv r:d}| j                             t          j                            |                     |dv r:d}| j                             t          j                            |                     |dk    rt          t          |          rJ d S t          t          |          }t          t          |          }t          t          j        |          j                  }|dk    rdh}n&t          t          j        |          j                  }t                      t                      }}|d	v rh d
}nl|dv rddh}nc|dv rdh}n[|dv r	h d}h d}nN|dv r	h d}ddh}nA|dv rh d}n8|dv rh d}n/|dv rddh}dh}n#|dv rdh}n|dv rdh}dh}n|dv rdh}n|dv rd dh}||z  |k    sJ ||z  |k    sJ ||z  }||z  }||k    sJ d S )!Nfirstlastz?first and last are entirely different between frame and groupbyreason)cumcountzDataFrame has no such methodngroupsizeselfanyall>   axiskwargs	bool_only)countnumeric_onlyr   )nuniquemaxmin>   r   r   skipna   engine	min_countengine_kwargsmeanstdsumvarr   r!   medianprodsembackfillbfillffillpad   r   inplacedowncastcummaxcumminr   argscumprodcumsum
pct_changer   rankquantilemethod)node
add_markerpytestmarkxfailhasattrr   getattrr   setinspect	signature
parameters)	requestgroupby_funcmsgframe_method	gb_methodresultexpectedexclude_expectedexclude_results	            e/var/www/html/t/fyr/venv311/lib/python3.11/site-packages/pandas/tests/groupby/test_api_consistency.pytest_frame_consistencyrV      s   (((O 1 1 1 = =>>>}$$, 1 1 1 = =>>>x9l333339l33L(,77I"9--899Fv8w(66ABB (+uuceen~%%:::		#	#*F3		%	%"8		'	'777AAA	6	6	6777"O4	2	2	2777	>	>	>:::	-	-	-$f-()	.	.	.$:		(	($: 		"	"*+		&	&$f- N"n4444&&*:::::
nF  HX    c                    |dv r:d}| j                             t          j                            |                     |dv r:d}| j                             t          j                            |                     |dk    rt          t          |          rJ d S t          t          |          }t          t          |          }t          t          j        |          j                  }|dk    rdh}n&t          t          j        |          j                  }t                      t                      }}|d	v rh d
}nk|dv rdh}nc|dv r	h d}h d}nV|dv r	h d}ddh}nI|dv rh d}n@|dv rh d}n7|dv rddh}dh}n+|dv rdh}n#|dv rdh}dh}n|dv rdh}n|dv rddh}n|dv rdh}||z  |k    sJ ||z  |k    sJ ||z  }||z  }||k    sJ d S ) Nr   z@first and last are entirely different between Series and groupbyr   )r   corrwithzSeries has no such methodr   r   r   r   >   r   r   r   )diffr   r   >   r   r   r   r   r"   r   r!   r'   r+   r0   r3   r   r6   r   r7   r:   r   r<   )idxminidxmaxr>   )rA   rB   rC   rD   rE   rF   r   rG   r   rH   rI   rJ   rK   )	rL   rM   rN   series_methodrP   rQ   rR   rS   rT   s	            rU   test_series_consistencyr^   R   s   (((P 1 1 1 = =>>>///) 1 1 1 = =>>>x6<00000FL11M|44I"9--899Fv8w(77BCC (+uuceen~%%:::		"	" 		'	'777AAA	6	6	6777"O4	2	2	2777	>	>	>:::	-	-	-$f-()	.	.	.$:		(	($: 		"	"*+	-	-	-"H-		&	&() N"n4444&&*:::::
nF  HXrW   )__doc__rI   rC   pandasr   r   pandas.core.groupby.genericr   r   rV   r^    rW   rU   <module>rc      s                    < < <~< < < < <rW   