| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Python312/Lib/site-packages/pandas/tests/groupby/__pycache__/ |
Upload File : |
�
/ �g!! � �d � d Z ddlZddlZddlmZmZ ddlmZmZm Z ddl
mZmZ d� Z
d� Zd� Zd � Zy)
z�
Tests of the groupby API, including internal consistency and with other pandas objects.
Tests in this file should only check the existence, names, and arguments of groupby
methods. It should not test the results of any groupby operation.
� N)� DataFrame�Series)�groupby_other_methods�reduction_kernels�transformation_kernels)�DataFrameGroupBy�
SeriesGroupByc � � | j d�� }t |� D �ch c] }|j d� r�|�� }}h d�}||k( sJ �y c c}w )N�second)�level�_>B �A�B�C�agg�all�any�cov�ewm�max�min�nth�sem�std�sum�var�corr�diff�head�hist�last�mean�ndim�ohlc�pipe�plot�prod�rank�size�skew�tail�take�apply�bfill�count�ffill�first�shift�cummax�cummin�cumsum�dtypes�fillna�filter�groups�idxmax�idxmin�median�ngroup�sample�boxplot�cumprod�indices�ngroups�nunique�rolling�corrwith�cumcount�describe�quantile�resample� aggregate� expanding� get_group� transform�
pct_change�value_counts)�groupby�dir�
startswith)� multiindex_dataframe_random_data�grp�v�results�expecteds �?C:\Python312\Lib\site-packages\pandas/tests/groupby/test_api.py�test_tab_completionrY sV � �
*�
2�
2��
2�
B�C��c�(�<�Q�!�,�,�s�*;�q�<�G�<�C�H�H �h�����K =s
�A �A c � � | j | j d d �df � }t |� D �ch c] }|j d� r�|�� c}t | j
� z
}t |� }|t z }|t z }|t z }t t z rJ �t t z rJ �t t z rJ �|rd|� d�}t |� �t t z t z }||k7 rd||z
� d�}t |� �y c c}w )Nr r
z?
There are uncategorized methods defined on the Grouper class:
aG .
Was a new method recently added?
Every public method On Grouper must appear in exactly one the
following three lists defined in pandas.core.groupby.base:
- `reduction_kernels`
- `transformation_kernels`
- `groupby_other_methods`
see the comments in pandas/core/groupby/base.py for guidance on
how to fix this test.
zI
Some methods which are supposed to be on the Grouper class
are missing:
z�.
They're still defined in one of the lists that live in pandas/core/groupby/base.py.
If you removed a method, you should update them
)
rP �ilocrQ rR �set�columnsr r r �AssertionError)rS rT r
�names� new_names�msg�all_categorizeds rX �test_all_methods_categorizedrc e s, � �
*�
2�
2�(�-�-�a��d�3��C� �C��:�1����S�(9�Q�:�S�(�0�0�>�
�E� �E�
�I�
�"�"�I�
�'�'�I�
�&�&�I� �#9�9�9�9� �#8�8�8�8�%�(=�=�=�=� ��
�� �
�� �S�!�!� (�*@�@�CX�X�O����� �5�� � ��� �S�!�!� ��A
;s �C8�C8c � � | dv rd}t j |�� | dv rt t | � rJ �y t t | � }t t
| � }t
t j |� j � }| dk( rdh}n(t
t j |� j � }t
� t
� }}| dv rh d�}nl| d v rd
dh}nc| dv rdh}n[| d
v r h d�}h d�}nN| dv r h d�}ddh}nA| dv rh d�}n8| dv rh d�}n/| dv rddh}d
h}n#| dv rdh}n| dv rdh}dh}n| dv rd
h}n| dv rddh}||z |k( sJ �||z |k( sJ �||z }||z }||k( sJ �y )N�r1 r! z?first and last are entirely different between frame and groupby)�reason)rF r= r) �self�r r > �axis�kwargs� bool_only)r/ �numeric_onlyri )rC �r r > ri rj �skipna> �engine� min_count�
engine_kwargs�r"