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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
U
¬ý°džƒã@s\dZddlmZddlmZmZddlZddlZddlm    Z    m
Z
m Z m Z m Z mZmZddlZddlZddlmZddlmZmZddlmZdd    lmZdd
lmZdd lmZm Z dd l!m"Z"m#Z#m$Z$m%Z%ddl&m'm(Z)dd l*m+Z+ddl,m-Z-ddl.m/Z/m0Z0ddl1m2Z2ddl3m4Z4Gdd„dƒZ5Gdd„de5ƒZ6Gdd„dƒZ7Gdd„dƒZ8dS)zC
Utilities for conversion to writer-agnostic Excel representation.
é)Ú annotations)Ú    lru_cacheÚreduceN)ÚAnyÚCallableÚHashableÚIterableÚMappingÚSequenceÚcast)Ú is_list_like)Ú
IndexLabelÚStorageOptions)Údoc)Úfind_stack_level)Úmissing)Úis_floatÚ    is_scalar)Ú    DataFrameÚIndexÚ
MultiIndexÚ PeriodIndex)Ú _shared_docs)Ú CSS4_COLORS)Ú CSSResolverÚ
CSSWarning)Úget_level_lengths)Ú pprint_thingc@s,eZdZdZeZd    ddddddœdd„ZdS)
Ú    ExcelCell©ÚrowÚcolÚvalÚstyleÚ
mergestartÚmergeendNÚintú
int | NoneÚNone)r r!r$r%ÚreturncCs(||_||_||_||_||_||_dS©Nr)Úselfr r!r"r#r$r%©r,úNd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/io/formats/excel.pyÚ__init__=s     zExcelCell.__init__)NNN)Ú__name__Ú
__module__Ú __qualname__Z
__fields__Ú    __slots__r.r,r,r,r-r9s ùrc    s0eZdZdddddddddœ‡fdd„ Z‡ZS)    Ú CssExcelCellr&z dict | Nonez3dict[tuple[int, int], list[tuple[str, Any]]] | NoneúCallable | Noner()r r!r#Ú
css_stylesÚcss_rowÚcss_colÚ css_converterr)c      sR|r2|r2dd„|||fDƒ}
t|
 ¡ƒ} || ƒ}tƒjf||||dœ|    —ŽdS)NcSsi|]\}}| ¡|“qSr,©Úlower)Ú.0Úpropr"r,r,r-Ú
<dictcomp>]sz)CssExcelCell.__init__.<locals>.<dictcomp>©r r!r"r#)Ú    frozensetÚitemsÚsuperr.) r+r r!r"r#r5r6r7r8ÚkwargsZdeclaration_dictZunique_declarations©Ú    __class__r,r-r.Os 
ÿ zCssExcelCell.__init__)r/r0r1r.Ú __classcell__r,r,rCr-r3Nsr3c@s.eZdZUdZeZdddddddœZddddddddddddddœ Zdddd    œZd
d d d dœZ    dd„dDƒZ
de d<dgdddœdd„Z e ƒZdddœdd„Zdddœdd „Zd!dd"œd#d$„Zd!d%d"œd&d'„Zd!dd"œd(d)„Zd!d*d"œd+d,„Zd!d-d"œd.d/„Zdddd0œd1d2„Zddd3œd4d5„Zdd6d7œd8d9„Zd:d6d;œd<d=„Zd!d>œd?d@„Zd!dAd"œdBdC„Zd!dDd"œdEdF„Zd!d*d"œdGdH„Zd!d*d"œdIdJ„Zd!dKd"œdLdM„ZdKddNœdOdP„Z d!d*d"œdQdR„Z!d!dKd"œdSdT„Z"d!dUd"œdVdW„Z#dXdYœdZd[„Z$ddd\œd]d^„Z%d:d_d`œdadb„Z&d:d:d`œdcdd„Z'd:d_d`œdedf„Z(dS)hÚCSSToExcelConverteraK
    A callable for converting CSS declarations to ExcelWriter styles
 
    Supports parts of CSS 2.2, with minimal CSS 3.0 support (e.g. text-shadow),
    focusing on font styling, backgrounds, borders and alignment.
 
    Operates by first computing CSS styles in a fairly generic
    way (see :meth:`compute_css`) then determining Excel style
    properties from CSS properties (see :meth:`build_xlstyle`).
 
    Parameters
    ----------
    inherited : str, optional
        CSS declarations understood to be the containing scope for the
        CSS processed by :meth:`__call__`.
    ÚtopÚcenterÚbottom)rGztext-topZmiddleZbaselinerIz text-bottomTF) ÚboldZbolderZ600Z700Z800Z900ÚnormalZlighterZ100Z200Z300Z400Ú500)rKÚitalicZobliqueéééé)Zserifz
sans-serifZcursiveZfantasycCsi|]}| ¡|“qSr,r9)r;r#r,r,r-r=¢sÿzCSSToExcelConverter.<dictcomp>)
ÚdashedZ mediumDashDotZ
dashDotDotÚhairÚdottedÚmediumDashDotDotÚdoubleZdashDotZ slantDashDotÚ mediumDashedzdict[str, str] | NoneÚ    inheritedNú
str | Noner()rXr)cCs2|dk    r| |¡|_nd|_tdd|jƒ|_dS)N)Úmaxsize)Ú compute_cssrXrÚ_call_uncachedÚ _call_cached)r+rXr,r,r-r.¸szCSSToExcelConverter.__init__z str | frozenset[tuple[str, str]]zdict[str, dict[str, str]])Ú declarationsr)cCs
| |¡S)aå
        Convert CSS declarations to ExcelWriter style.
 
        Parameters
        ----------
        declarations : str | frozenset[tuple[str, str]]
            CSS string or set of CSS declaration tuples.
            e.g. "font-weight: bold; background: blue" or
            {("font-weight", "bold"), ("background", "blue")}
 
        Returns
        -------
        xlstyle : dict
            A style as interpreted by ExcelWriter when found in
            ExcelCell.style.
        )r])r+r^r,r,r-Ú__call__ÄszCSSToExcelConverter.__call__cCs| ||j¡}| |¡Sr*)r[rXÚ build_xlstyle)r+r^Z
propertiesr,r,r-r\Ùsz"CSSToExcelConverter._call_uncachedzMapping[str, str])Úpropsr)csN| |¡| |¡| |¡| |¡| |¡dœ}dddœ‡fdd„ ‰ˆ|ƒ|S)N)Ú    alignmentZborderÚfillÚfontZ number_formatúdict[str, str | None]r()Údr)csFt| ¡ƒD]4\}}|dkr$||=q t|tƒr ˆ|ƒ|s ||=q dS)z4Remove key where value is None, through nested dictsN)Úlistr@Ú
isinstanceÚdict)rfÚkÚv©Ú remove_noner,r-rmês
z6CSSToExcelConverter.build_xlstyle.<locals>.remove_none)Úbuild_alignmentÚ build_borderÚ
build_fillÚ
build_fontÚbuild_number_format)r+raÚoutr,rlr-r`ßsû
 
z!CSSToExcelConverter.build_xlstylezdict[str, bool | str | None]cCs| d¡| |¡| |¡dœS)Nz
text-align)Ú
horizontalÚverticalÚ    wrap_text)ÚgetÚ_get_vertical_alignmentÚ_get_is_wrap_text©r+rar,r,r-rn÷sýz#CSSToExcelConverter.build_alignmentcCs| d¡}|r|j |¡SdS)Nzvertical-align)rwÚ VERTICAL_MAP)r+raZvertical_alignr,r,r-rxÿs
 z+CSSToExcelConverter._get_vertical_alignmentz bool | NonecCs"| d¡dkrdSt|ddkƒS)Nz white-space)ZnowrapÚprezpre-line)rwÚboolrzr,r,r-rysz%CSSToExcelConverter._get_is_wrap_textz dict[str, dict[str, str | None]]cs‡‡fdd„dDƒS)Ncsfi|]^}|ˆ ˆ d|›d¡ˆ d|›d¡ˆ ˆ d|›d¡¡¡ˆ ˆ d|›d¡¡dœ“qS)zborder-z-stylez-widthz-color)r#Úcolor)Ú _border_stylerwÚcolor_to_excel)r;Zside©rar+r,r-r= s    øýúz4CSSToExcelConverter.build_border.<locals>.<dictcomp>©rGÚrightrIÚleftr,rzr,rr-ro
s     ÷z CSSToExcelConverter.build_border)r#Úwidthr~cCsÒ|dkr|dkr|dkrdS|dkr0|dkr0dS|dkr<dS| |¡}|dkrRdS|dkr^|S|dkrjdS|dkr‚|dkr~dSdS|dkrš|dkr–dSd    S||jkr®|j|Stjd
t|ƒ›ttƒd dSdS) NÚnone)r†Úhidden)NZgrooveZridgeZinsetZoutsetÚsolidrVrT)rSÚthinrUrRrWzUnhandled border style format: ©Ú
stacklevel)Ú_get_width_nameÚBORDER_STYLE_MAPÚwarningsÚwarnÚreprrr)r+r#r…r~Z
width_namer,r,r-rs:
 
 
 ýz!CSSToExcelConverter._border_style)Ú width_inputr)cCs2| |¡}|dkrdS|dkr"dS|dkr.dSdS)Ngñh㈵øä>gÍÌÌÌÌÌô?r‰gffffff@ZmediumZthick)Ú_width_to_float)r+r‘r…r,r,r-rŒPs
z#CSSToExcelConverter._get_width_nameÚfloat)r…r)cCs|dkr d}| |¡S)NZ2pt)Ú _pt_to_float)r+r…r,r,r-r’Zsz#CSSToExcelConverter._width_to_floatÚstr)Ú    pt_stringr)cCs| d¡st‚t| d¡ƒS)NÚpt)ÚendswithÚAssertionErrorr“Úrstrip)r+r–r,r,r-r”_sz CSSToExcelConverter._pt_to_float)racCs&| d¡}|dkr"| |¡ddœSdS)Nzbackground-color)NZ transparentr†rˆ)ZfgColorZ patternType)rwr€)r+raZ
fill_colorr,r,r-rpcs
zCSSToExcelConverter.build_fillrecCs,| d¡}t|tƒr | dd¡n|}d|iS)Nz number-formatõ§ú;Z format_code)rwrhr•Úreplace)r+raZfcr,r,r-rrjs
z'CSSToExcelConverter.build_number_formatz$dict[str, bool | float | str | None]c Csv| |¡}| |¡}|r |dnd| |¡| |¡| |¡| |¡d|krNdndd|kpZd| | d¡¡| |¡dœ    S)NrÚ    underlineÚsinglez line-throughr~)    ÚnameÚfamilyÚsizerJrMržÚstriker~Zshadow)    Ú_get_font_namesÚ_get_decorationÚ_select_font_familyÚ_get_font_sizeÚ _get_is_boldÚ_get_is_italicr€rwÚ _get_shadow)r+raÚ
font_namesÚ
decorationr,r,r-rqos
 
 
özCSSToExcelConverter.build_fontcCs| d¡}|r|j |¡SdS)Nz font-weight)rwÚBOLD_MAP)r+raZweightr,r,r-r¨s
 z CSSToExcelConverter._get_is_boldcCs| d¡}|r|j |¡SdS)Nz
font-style)rwÚ
ITALIC_MAP)r+raZ
font_styler,r,r-r©‡s
 z"CSSToExcelConverter._get_is_italicz Sequence[str]cCs"| d¡}|dk    r| ¡SdSdS)Nztext-decorationr,)rwÚsplit)r+rar¬r,r,r-r¥s
z#CSSToExcelConverter._get_decoration)r¬r)cCsd|kr dSdS)NržrŸr,)r+r¬r,r,r-Ú_get_underline”sz"CSSToExcelConverter._get_underlinecCs d|krtt d|d¡ƒSdS)Nz text-shadowz ^[^#(]*[1-9])r}ÚreÚsearchrzr,r,r-rª™szCSSToExcelConverter._get_shadowcCsˆt d| dd¡¡}g}|D]f}|dd…dkrF|dd… dd¡}n.|dd…dkrl|dd… d    d¡}n| ¡}|r| |¡q|S)
Nz›(?x)
            (
            "(?:[^"]|\\")+"
            |
            '(?:[^']|\\')+'
            |
            [^'",]+
            )(?=,|\s*$)
        z font-familyÚrNú"éÿÿÿÿz\"ú'z\')r±ÚfindallrwrÚstripÚappend)r+raZfont_names_tmpr«r r,r,r-r¤žs    
ö  z#CSSToExcelConverter._get_font_namesz float | NonecCs | d¡}|dkr|S| |¡S)Nz    font-size)rwr”)r+rar¢r,r,r-r§¸s
z"CSSToExcelConverter._get_font_sizer'©r)cCs&d}|D]}|j |¡}|rq"q|Sr*)Ú
FAMILY_MAPrw)r+r«r¡r r,r,r-r¦¾s  z'CSSToExcelConverter._select_font_family)r"r)cCsb|dkr dS| |¡r | |¡Sz |j|WStk
r\tjdt|ƒ›ttƒdYnXdS)NzUnhandled color format: rŠ)    Ú _is_hex_colorÚ_convert_hex_to_excelÚ NAMED_COLORSÚKeyErrorrŽrrrr©r+r"r,r,r-r€Çs
 
  ý z"CSSToExcelConverter.color_to_excelr})Ú color_stringr)cCst| d¡ƒS)Nú#)r}Ú
startswith)r+rÁr,r,r-r¼Øsz!CSSToExcelConverter._is_hex_colorcCsH| d¡}| |¡r<|dd|dd|dd ¡S| ¡SdS)NrÂrrOrN)ÚlstripÚ_is_shorthand_colorÚupper©r+rÁÚcoder,r,r-r½Ûs
 
(z)CSSToExcelConverter._convert_hex_to_excelcCs<| d¡}t|ƒdkrdSt|ƒdkr*dStd|›ƒ‚dS)zcCheck if color code is shorthand.
 
        #FFF is a shorthand as opposed to full #FFFFFF.
        rÂéTéFzUnexpected color N)rÄÚlenÚ
ValueErrorrÇr,r,r-rÅâs 
  z'CSSToExcelConverter._is_shorthand_color)N))r/r0r1Ú__doc__rr¾r{r­r®r»rÚ__annotations__r.rr[r_r\r`rnrxryrorrŒr’r”rprrrqr¨r©r¥r°rªr¤r§r¦r€r¼r½rÅr,r,r,r-rFgs€
ú óýüþ
7
    rFc @seZdZdZdZdZd8d    d
d d d dd d    dddœ
dd„Zeddœdd„ƒZdd„Z    ddœdd„Z
ddœdd„Z ddœdd „Z ddœd!d"„Z ddœd#d$„Zddœd%d&„Zed dœd'd(„ƒZd)dd*œd+d,„Zddœd-d.„Zeed/d0d9d    d)d)d3d
d4dd5œd6d7„ƒZdS):ÚExcelFormattera9
    Class for formatting a DataFrame to a list of ExcelCells,
 
    Parameters
    ----------
    df : DataFrame or Styler
    na_rep: na representation
    float_format : str, default None
        Format string for floating point numbers
    cols : sequence, optional
        Columns to write
    header : bool or sequence of str, default True
        Write out column names. If a list of string is given it is
        assumed to be aliases for the column names
    index : bool, default True
        output row names (index)
    index_label : str or sequence, default None
        Column label for index column(s) if desired. If None is given, and
        `header` and `index` are True, then the index names are used. A
        sequence should be given if the DataFrame uses MultiIndex.
    merge_cells : bool, default False
        Format MultiIndex and Hierarchical Rows as merged cells.
    inf_rep : str, default `'inf'`
        representation for np.inf values (which aren't representable in Excel)
        A `'-'` sign will be added in front of -inf.
    style_converter : callable, optional
        This translates Styler styles (CSS) into ExcelWriter styles.
        Defaults to ``CSSToExcelConverter()``.
        It should have signature css_declarations string -> excel style.
        This is only called for body cells.
    ii@r³NTFÚinfr•rYzSequence[Hashable] | NonezSequence[Hashable] | boolr}zIndexLabel | Noner4r()
Úna_repÚ float_formatÚcolsÚheaderÚindexÚ index_labelÚ merge_cellsÚinf_repÚstyle_converterr)c Csàd|_||_t|tƒsB||_|j ¡|j}|
dkr:tƒ}
|
|_n d|_d|_||_    |dk    r®t
t |ƒ  |j ¡ƒsxtdƒ‚t
t |ƒ  |j ¡ƒt
t|ƒƒkr tdƒ‚|j|d|_    |j    j |_ ||_||_||_||_||_|    |_dS)Nrz,passes columns are not ALL present dataframez.Not all names specified in 'columns' are found)Úcolumns)Ú
rowcounterrÑrhrÚstylerZ_computeÚdatarFrÙÚdfrËrÚ intersectionrÚr¿ÚsetZreindexrÒrÕrÖrÔr×rØ) r+rÞrÑrÒrÓrÔrÕrÖr×rØrÙr,r,r-r.s2 
 
 
zExcelFormatter.__init__z dict[str, dict[str, str | bool]]rºcCs ddidddddœdddœdœS)    NrJTr‰r‚rHrG)rtru)rdZbordersrbr,©r+r,r,r-Ú header_styleAsüøzExcelFormatter.header_stylecCs€t|ƒrt |¡r|j}nJt|ƒrdt |¡r4|j}n0t |¡rLd|j›}n|jdk    rdt    |j|ƒ}t
|ddƒdk    r|t dƒ‚|S)Nú-Útzinfoz{Excel does not support datetimes with timezones. Please ensure that datetimes are timezone unaware before writing to Excel.) rrZisnarÑrZisposinf_scalarrØZisneginf_scalarrÒr“ÚgetattrrÌrÀr,r,r-Ú _format_valueNs
 
 
ÿzExcelFormatter._format_valuezIterable[ExcelCell]ccsª|jjdkr|jstdƒ‚|js*|js*dS|j}|j|jddd}t|ƒ}d}d}|jrzt    |j
jt ƒrzt |j
jdƒd}|jrHt |jƒD]\}}t||||jdVqŒt t||j|jƒƒD]†\}\}}}    | |    ¡}
| ¡D]d\} } d\} }| dkr
||| | } }t||| d|
| |jt|jddƒ|| |j| |d    
VqÞq¾nXt t|ŽƒD]J\} }
d
 tt|
ƒ¡}t||| d||jt|jddƒ|| |jd VqT||_dS) NrNz]Writing to Excel with MultiIndex columns and no index ('index'=False) is not yet implemented.F©ZsparsifyZadjoinÚnamesrr>©NNÚ ctx_columns©
r r!r"r#r5r6r7r8r$r%Ú.©r r!r"r#r5r6r7r8)rÚZnlevelsrÕÚNotImplementedErrorÚ _has_aliasesrÔÚformatr×rrhrÞrrËÚ    enumeraterèrrâÚzipÚlevelsÚcodesÚtaker@r3rårÜrÙÚjoinÚmaprrÛ)r+rÚÚ
level_strsÚ level_lengthsÚ    coloffsetÚlnumr ÚspansróÚ level_codesÚvaluesÚiÚspan_valr$r%rkr,r,r-Ú_format_header_mi`sv ÿ ÿü
ÿ
 
 
 ö
 ø z ExcelFormatter._format_header_mic csÐ|js |jrÌd}|jr6d}t|jjtƒr6t|jjjƒ}|j}|jrŒt    t
|jƒ|_t|jƒt|jƒkr†t dt|jƒ›dt|jƒ›dƒ‚|j}t |ƒD]6\}}t |j||||jt|jddƒd||jdVq”dS)NrrNzWriting z cols but got z aliasesrêrí)rïrÔrÕrhrÞrrËrèrÚr r
rÌrñr3rÛrârårÜrÙ)r+rúZcolnamesÚcolindexZcolnamer,r,r-Ú_format_header_regular¥s2 ÿ øz%ExcelFormatter._format_header_regularcs˜tˆjtƒrˆ ¡}nˆ ¡}d}ˆjjjrŒdd„ˆjjjDƒdgtˆjƒ}t    dd„t
dd„|ƒƒrŒ‡fdd    „t |ƒDƒ}ˆj d
7_ t  ||¡S) Nr,cSsg|]}|dk    r|nd‘qS©Nr³r,)r;Úxr,r,r-Ú
<listcomp>Ïsz1ExcelFormatter._format_header.<locals>.<listcomp>r³cSs|o|Sr*r,)rÚyr,r,r-Ú<lambda>Òóz/ExcelFormatter._format_header.<locals>.<lambda>cSs|dkSrr,)rr,r,r-rÒr    c3s$|]\}}tˆj||ˆjƒVqdSr*)rrÛrâ)r;rr"rár,r-Ú    <genexpr>Ósÿz0ExcelFormatter._format_header.<locals>.<genexpr>rN)rhrÚrrrrÞrÕrèrËrr÷rñrÛÚ    itertoolsÚchain)r+ÚgenZgen2r r,rár-Ú_format_headerÄs  
 
ÿþ
þzExcelFormatter._format_headercCs"t|jjtƒr| ¡S| ¡SdSr*)rhrÞrÕrÚ_format_hierarchical_rowsÚ_format_regular_rowsrár,r,r-Ú _format_bodyÚszExcelFormatter._format_bodyc cs2|js |jr|jd7_|jr|jrJt|jtttj    t
fƒrJ|jd}n(|jrdt|jt ƒrd|j}n|j jj d}t|jtƒrŒ|jd7_|r²|jdk    r²t|jdd||jƒV|j j}t|j jtƒrÔ|j j ¡}t|ƒD]6\}}t|j|d||jt|jddƒ|d|jdVqÜd}nd}| |¡EdHdS)NrNrFÚ    ctx_indexrí)rïrÔrÛrÕrÖrhrgÚtupleÚnpÚndarrayrr•rÞrèrÚrrrârZ to_timestamprñr3rårÜrÙÚ_generate_body)r+rÖZ index_valuesÚidxZidxvalrúr,r,r-ràs@  ÿ    ø
 
z#ExcelFormatter._format_regular_rowsccsú|js |jr|jd7_d}|jræ|jjj}|jrRt|jtt    t
j t fƒrR|j}t|j tƒrr|jrr|jd7_tj|Žr°|jdk    r°t|ƒD] \}}t|jd|||jƒVqŽ|jrˆ|jjjdddd}t|ƒ}t||jjj|jjjƒD]˜\}}}    |j|    |j|jd}
| ¡D]h\} } d\} }| dkrB|j| | d} |}t|j| ||
| |jt|j ddƒ| ||j!| |d    
Vq|d7}qìn^t|jjŽD]P}t|ƒD]8\}}t|j||||jt|j ddƒ|||j!d
Vq |d7}q”| "|¡EdHdS) NrNrFTrç)Z
allow_fillZ
fill_valuerérrërí)#rïrÔrÛrÕrÞrèrÖrhrgrrrrrÚrr×ÚcomZ any_not_nonerñrrârðrròrórôrõZ _can_hold_naZ    _na_valuer@r3rårÜrÙr)r+ZgcolidxZ index_labelsZcidxr rørùrürórýrþrÿrr$r%Z indexcolvalsrZ indexcolvalr,r,r-rs€ 
 ÿÿÿý
 ö  ø
z(ExcelFormatter._format_hierarchical_rowscCs
t|jƒS)z1Whether the aliases for column names are present.)r rÔrár,r,r-rï]szExcelFormatter._has_aliasesr&)rúr)c csntt|jƒƒD]Z}|jjdd…|f}t|ƒD]8\}}t|j||||dt|j    ddƒ|||j
dVq.qdS)NÚctxrí) ÚrangerËrÚrÞZilocrñr3rÛrårÜrÙ)r+rúZcolidxZseriesrÿr"r,r,r-rbs øzExcelFormatter._generate_bodyccs2t | ¡| ¡¡D]}| |j¡|_|VqdSr*)r r rrrær")r+Úcellr,r,r-Úget_formatted_cellsrsz"ExcelFormatter.get_formatted_cellsÚstorage_options)rÚSheet1rztuple[int, int] | Noner)Ú
sheet_nameÚstartrowÚstartcolÚ freeze_panesÚenginerr)c     Cs¦ddlm}|jj\}    }
|    |jks,|
|jkrPtd|    ›d|
›d|j›d|j›ƒ‚| ¡} t||ƒrhd} n||||d}d} z|j
| ||||d    W5| r |     ¡Xd
S) a 
        writer : path-like, file-like, or ExcelWriter object
            File path or existing ExcelWriter
        sheet_name : str, default 'Sheet1'
            Name of sheet which will contain DataFrame
        startrow :
            upper left cell row to dump data frame
        startcol :
            upper left cell column to dump data frame
        freeze_panes : tuple of integer (length 2), default None
            Specifies the one-based bottommost row and rightmost column that
            is to be frozen
        engine : string, default None
            write engine to use if writer is a path - you can also set this
            via the options ``io.excel.xlsx.writer``,
            or ``io.excel.xlsm.writer``.
 
        {storage_options}
 
            .. versionadded:: 1.2.0
        r)Ú ExcelWriterz-This sheet is too large! Your sheet size is: z, z Max sheet size is: F)r#rT)r r!r"N) Zpandas.io.excelr$rÞÚshapeÚmax_rowsÚmax_colsrÌrrhÚcloseZ _write_cells) r+Úwriterrr r!r"r#rr$Znum_rowsZnum_colsZformatted_cellsZ    need_saver,r,r-Úwritews2   ÿ
ÿû
    zExcelFormatter.write)    r³NNTTNFrÐN)rrrNNN)r/r0r1rÍr&r'r.Úpropertyrârærrrrrrrïrrrrr*r,r,r,r-rÏðsD õ"- E.O ørÏ)9rÍÚ
__future__rÚ    functoolsrrr r±Útypingrrrrr    r
r rŽÚnumpyrZpandas._libs.libr Zpandas._typingr rZpandas.util._decoratorsrZpandas.util._exceptionsrZpandas.core.dtypesrZpandas.core.dtypes.commonrrZpandasrrrrZpandas.core.commonÚcoreÚcommonrZpandas.core.shared_docsrZpandas.io.formats._color_datarZpandas.io.formats.cssrrZpandas.io.formats.formatrZpandas.io.formats.printingrrr3rFrÏr,r,r,r-Ú<module>s6 $