3
���hD � @ s^ d Z ddlZddlmZmZ ejdddg�ZG dd� d�Zed d
g�Z eddd
ddddddddg�e B Z
e
ddddhB eddg�B Ze
eddg�B Zeddd d!d"g�Z
ed#d$d%ddg�Zed&d'dd$d(ddd)d
d*d+d,d-d.d/d0d1dd2d%dd3d4d5g�Zed6d7d8d"d!dddd9dd:d;d#d dg�Zed<d=d>d?ddd@ddAdBdCdDdEd
dFdGdHdIdJd dKdLdMddNdOg�ZeeB ZdS )Pz�
Provide basic components for groupby. These definitions
hold the allowlist of methods that are exposed on the
SeriesGroupBy and the DataFrameGroupBy objects.
� N)�is_list_like� is_scalar� OutputKey�label�positionc @ s e Zd ZdZddd�ZdS )�GroupByMixinz=
Provide the groupby facilities to the mixed object.
Nc
s� |dkr� j }� fdd�� jD �}y� j| }W n tk
rJ � j}Y nX t� �|f|� d�|��� � j� |jdkr�t|�r�||ks�t|�r�|� _ � S )a
Sub-classes to define. Return a sliced object.
Parameters
----------
key : string / list of selections
ndim : 1,2
requested ndim of result
subset : object, default None
subset to act on
Nc s i | ]}t � |�|�qS � )�getattr)�.0�attr)�selfr �:/tmp/pip-build-5_djhm0z/pandas/pandas/core/groupby/base.py�
<dictcomp>$ s z)GroupByMixin._gotitem.<locals>.<dictcomp>)�groupby�parent� )
�obj�_attributesZ_groupby�
IndexError�type�_reset_cache�ndimr r Z
_selection)r �keyr Zsubset�kwargsr r )r r
�_gotitem s
zGroupByMixin._gotitem)N)�__name__�
__module__�__qualname__�__doc__r r r r r
r
s r Zplot�histZquantileZfillnaZmadZtakeZidxmaxZidxminZtshiftZskewZcorrZcovZdiff�nlargest� nsmallestZis_monotonic_increasingZis_monotonic_decreasingZdtype�uniqueZdtypesZcorrwithZcumprodZcumsum�shiftZcumminZcummaxZrank�count�size�all�any�first�last�maxZmeanZmedian�minZngroupZnthZnunique�prodZsemZstd�sum�varZbackfillZbfillZcumcountZffill�padZ
pct_changeZaggZ aggregate�applyZboxplotZdescribeZ expanding�filterZ get_group�groups�head�indicesr ZngroupsZohlc�pipeZresampleZrolling�tailZ transform�sample)r �collectionsZpandas.core.dtypes.commonr r �
namedtupler r � frozensetZplotting_methodsZcommon_apply_allowlistZseries_apply_allowlistZdataframe_apply_allowlistZcythonized_kernelsZcython_cast_blocklistZreduction_kernelsZtransformation_kernelsZgroupby_other_methodsZtransform_kernel_allowlistr r r r
�<module> s� ) |