
    'Whd                        d dl mZ d dlmZ d dlmZmZ d dlZd dlm	Z	 d dl
mZ d dlmZ d dlmZ d d	lmZmZ d d
lmZ e G d de             Ze G d de             Ze G d de             Zy)    )annotations)	dataclass)ClassVarCallableN)	DataFrame)Scale)GroupBy)Stat)EstimateAggregatorWeightedAggregator)Vectorc                  J    e Zd ZU dZdZded<   dZded<   	 	 	 	 	 	 	 	 	 	 d
dZy	)Agga`  
    Aggregate data along the value axis using given method.

    Parameters
    ----------
    func : str or callable
        Name of a :class:`pandas.Series` method or a vector -> scalar function.

    See Also
    --------
    objects.Est : Aggregation with error bars.

    Examples
    --------
    .. include:: ../docstrings/objects.Agg.rst

    meanstr | Callable[[Vector], float]funcTClassVar[bool]group_by_orientc                    dddj                  |      }|j                  ||| j                  i      j                  |g      j	                  d      }|S )Nyxr   r   subsetTdrop)getaggr   dropnareset_index)selfdatagroupbyorientscalesvarress          T/var/www/html/jupyter_env/lib/python3.12/site-packages/seaborn/_stats/aggregation.py__call__zAgg.__call__)   sW     c"&&v.STYY'(VC5V![d[#	 	 
    N
r"   r   r#   r	   r$   strr%   zdict[str, Scale]returnr   )__name__
__module____qualname____doc__r   __annotations__r   r)    r*   r(   r   r      sK    " -3D
)2&*O^*(/9<FV	r*   r   c                      e Zd ZU dZdZded<   dZded<   dZd	ed
<   dZded<   dZ	ded<   	 	 	 	 	 	 	 	 ddZ
	 	 	 	 	 	 	 	 	 	 ddZy)Esta,  
    Calculate a point estimate and error bar interval.

    For more information about the various `errorbar` choices, see the
    :doc:`errorbar tutorial </tutorial/error_bars>`.

    Additional variables:

    - **weight**: When passed to a layer that uses this stat, a weighted estimate
      will be computed. Note that use of weights currently limits the choice of
      function and error bar method  to `"mean"` and `"ci"`, respectively.

    Parameters
    ----------
    func : str or callable
        Name of a :class:`numpy.ndarray` method or a vector -> scalar function.
    errorbar : str, (str, float) tuple, or callable
        Name of errorbar method (one of "ci", "pi", "se" or "sd"), or a tuple
        with a method name ane a level parameter, or a function that maps from a
        vector to a (min, max) interval.
    n_boot : int
       Number of bootstrap samples to draw for "ci" errorbars.
    seed : int
        Seed for the PRNG used to draw bootstrap samples.

    Examples
    --------
    .. include:: ../docstrings/objects.Est.rst

    r   r   r   )ci_   zstr | tuple[str, float]errorbari  intn_bootNz
int | NoneseedTr   r   c                @     |||      }t        j                  |g      S N)pdr   )r!   r"   r&   	estimatorr'   s        r(   _processzEst._process^   s!    
 c"||SE""r*   c                   | j                   | j                  d}d|v r"t        | j                  | j                  fi |}n!t        | j                  | j                  fi |}ddd|   }|j                  || j                  ||      j                  |g      j                  d      }|j                  | d	||   | d
||   i      }|S )N)r:   r;   weightr   r   r   r   Tr   minmax)r:   r;   r   r   r8   r   applyr@   r   r    fillna)	r!   r"   r#   r$   r%   boot_kwsenginer&   r'   s	            r(   r)   zEst.__call__f   s     #kk499=t'		4==MHMF'		4==MHMFc"6*U4V4VC5V![d[#	 	 jjSE+s3xC5c#hGH
r*   )r"   r   r&   r,   r?   r   r-   r   r+   )r.   r/   r0   r1   r   r2   r8   r:   r;   r   r@   r)   r3   r*   r(   r5   r5   7   s    < -3D
)2(2H%2FCD*&*O^*##$'#4F#	#(/9<FV	r*   r5   c                      e Zd Z	 d Zy)Rollingc                     y r=   r3   )r!   r"   r#   r$   r%   s        r(   r)   zRolling.__call__   s    r*   N)r.   r/   r0   r)   r3   r*   r(   rJ   rJ   }   s
    r*   rJ   )
__future__r   dataclassesr   typingr   r   pandasr>   r   seaborn._core.scalesr   seaborn._core.groupbyr	   seaborn._stats.baser
   seaborn._statisticsr   r   seaborn._core.typingr   r   r5   rJ   r3   r*   r(   <module>rU      s}    " ! %   & ) $ ( !$ ! !H B$ B BJ d  r*   