1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
Ë
nñúh¹.ãó–—dZddlmZddlmZmZddlmZmZm    Z    ddl
Z ddl m Z ddlmZmZmZddlmZdd    lmZmZdd
lmZmZmZdd lmZdd 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      úOH:\Change_password\venv_build\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(r t d«‚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
}dd lm} | |||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|«kr td«‚|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*)
rr rrarrar ú#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
r r Ú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*