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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
U
¬ý°džWã
@sddlmZddlmZddlmZddlZddlmZm    Z    m
Z
m Z m Z m Z mZmZmZmZddlmZddlZddlmZddlmZdd    lmZmZdd
lmZdd lm Z m!Z!m"Z"dd l#m$Z$dd l%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+ddl,m-Z-ddl.m/m0Z1edddZ2ddl3m4Z5ee6e    fZ7ee7e ee e7ffZ8ee6ee6e9ffZ:e e:Z;ee6e;fZ<Gdd„deƒZ=e e=Z>ee?ee'fZ@Gdd„dƒZAddddddœdd„ZBdid d!d"œd#d$„ZCdjd%dd&d'd(œd)d*„ZDdd+œd,d-„ZEd.d.d/œd0d1„ZFdkdd&ddd3œd4d5„ZGd6ddd6d7œd8d9„ZHd:d;„ZId<d=„ZJdld?dd@ddddd6dAœdBdC„ZKdDdEœdFdG„ZLdHdIdJœdKdL„ZMdMd%dNdOœdPdQ„ZNGdRdS„dSƒZOd.dddTœdUdV„ZPd.dddWœdXdY„ZQdmdIddddZœd[d\„ZRdnd]dddddd^œd_d`„ZSdadddbœdcdd„ZTdIdId/œdedf„ZUdgdh„ZVdS)oé)Ú annotations)Ú defaultdict)ÚpartialN)
ÚAnyÚCallableÚ DefaultDictÚDictÚListÚOptionalÚSequenceÚTupleÚ    TypedDictÚUnion)Úuuid4)Ú
get_option)Úlib)ÚAxisÚLevel)Úimport_optional_dependency)Ú
is_complexÚis_floatÚ
is_integer)Ú    ABCSeries)Ú    DataFrameÚIndexÚ
IndexSliceÚ
MultiIndexÚSeriesÚisna)Ú is_list_likeÚjinja2z DataFrame.style requires jinja2.)Úextra©Úescapec@seZdZUded<ded<dS)ÚCSSDictÚstrÚselectorÚ CSSPropertiesÚpropsN)Ú__name__Ú
__module__Ú __qualname__Ú__annotations__©r-r-úUd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/io/formats/style_render.pyr$;s
r$c @sèeZdZdZe dd¡ZejeddZe     d¡Z
e     d¡Z e     d¡Z e     d    ¡Z e     d
¡ZdWd dddddddddœ    dd„ZdXddddddœdd„ZdYddddddœdd„Zddddd œd!d"„ZdZddddddœd#d$„Zd%d&„Zd[dddddd(d)œd*d+„Zddd,œd-d.„Zd/dd0d1œd2d3„Zd/dd0d1œd4d5„Zd0ddd6œd7d8„Zd\ddd:ddddd;œd<d=„Zdd:d>œd?d@„Zd/dd0dAœdBdC„Zd0dddDœdEdF„Zd]dHdIddddddddJœ    dKdL„Zd^dHdNdOddddddddPœ
dQdR„Zd_dSdNdOddTœdUdV„Z d S)`ÚStylerRendererzT
    Base class to process rendering a Styler with a specified jinja2 template.
    Úpandaszio/formats/templatesT)ÚloaderZ trim_blockszhtml.tplzhtml_table.tplzhtml_style.tplz    latex.tplz
string.tplNézDataFrame | Seriesú
str | NoneÚintzCSSStyles | Nonezstr | tuple | list | NoneÚboolú
int | NoneÚNone)    ÚdataÚuuidÚuuid_lenÚ table_stylesÚtable_attributesÚcaptionÚcell_idsÚ    precisionÚreturnc         stt|tƒr| ¡}t|tƒs$tdƒ‚||_|j|_|j|_t|tƒrL|dkrTtdƒ‚|plt    ƒj
dt d|ƒ…|_ t |j ƒ|_||_||_||_||_ddddd    d
d d d dddœ |_g|_d|_d|_dg|jj|_dg|jj|_g|_g|_ttƒ|_ttƒ|_ttƒ|_ tt!ƒ|_"g|_#d|_$ˆdkr6t%dƒnˆ‰t‡fdd„ƒ|_&t‡fdd„ƒ|_'t‡fdd„ƒ|_(dS)Nz&``data`` must be a Series or DataFramerz1``uuid_len`` must be an integer in range [0, 32].é Ú row_headingÚ col_headingÚ
index_nameÚcolÚrowÚcol_trimÚrow_trimÚlevelr8ÚblankÚfoot) rBrCrDrErFrGrHrIr8rJrKFústyler.format.precisioncs ttˆdS©N©r?©rÚ_default_formatterr-rNr-r.Ú<lambda>Œóz)StylerRenderer.__init__.<locals>.<lambda>cs ttˆdSrMrOr-rNr-r.rQrRcs ttˆdSrMrOr-rNr-r.rQ’rR))Ú
isinstancerZto_framerÚ    TypeErrorr8ÚindexÚcolumnsr4rÚhexÚminr9Úlenr:r;r<r=r>ÚcssÚ concatenatedÚhide_index_namesÚhide_column_namesÚnlevelsÚ hide_index_Ú hide_columns_Ú hidden_rowsÚhidden_columnsrÚlistÚctxÚ    ctx_indexÚ ctx_columnsr%Ú cell_contextÚ_todoÚtooltipsrÚ_display_funcsÚ_display_funcs_indexÚ_display_funcs_columns)    Úselfr8r9r:r;r<r=r>r?r-rNr.Ú__init__Qs`
 
 õ 
 
 
 
ÿþþþzStylerRenderer.__init__Úr%)Ú sparse_indexÚsparse_columnsÚmax_rowsÚmax_colsrJcCs| ¡g}t|jƒ}t|jƒD]Ö\}}    |j|    _|j|    _|jd›|›}
|j|
›d|
›d|
›d|
›ddœ–|    _|     |||||¡} |     | ¡|    j
  ¡D]\\} } }||j
| || f<qž|    j   ¡D]\\} } }||j | || f<qÈ|t|    jƒ7}q |  ||||||¡}|S)zâ
        Computes and applies styles and then generates the general render dicts.
 
        Also extends the `ctx` and `ctx_index` attributes with those of concatenated
        stylers for use within `_translate_latex`
        rKÚ_dataZ _row_headingÚ_rowZ_foot)r8rBrFrK)Ú_computerYrUÚ    enumerater[r_rbrZÚ_renderÚappendrdÚitemsreÚ
_translate)rmrprqrrrsrJÚdxsZctx_lenÚir[rKÚdxÚrÚcÚvÚdr-r-r.rx”sF
û
ÿ
ÿzStylerRenderer._render)rprqrrrsr@cKs8| ||||d¡}| |¡|jjf||j|jdœ—ŽS)z˜
        Renders the ``Styler`` including all applied styles to HTML.
        Generates a dict with necessary kwargs passed to jinja2 template.
        ú&nbsp;)Zhtml_table_tplZhtml_style_tpl)rxÚupdateÚ template_htmlÚrenderÚtemplate_html_tableÚtemplate_html_style©rmrprqrrrsÚkwargsr‚r-r-r.Ú _render_htmlÁs 
ýzStylerRenderer._render_html)rprqÚclinesr@cKsf| ||dd¡}|j||dt|jjd<t|jjd<t|jjd<t|jjd<| |¡|jj    f|ŽS)z1
        Render a Styler in latex format
        N)rŒZ
parse_wrapZ parse_tableZ
parse_cellÚ parse_header)
rxÚ_translate_latexÚ_parse_latex_table_wrappingÚtemplate_latexÚglobalsÚ_parse_latex_table_stylesÚ_parse_latex_cell_stylesÚ_parse_latex_header_spanr„r†)rmrprqrŒrŠr‚r-r-r.Ú _render_latexÕs    
zStylerRenderer._render_latexcKs(| ||||¡}| |¡|jjf|ŽS)z2
        Render a Styler in string format
        )rxr„Útemplate_stringr†r‰r-r-r.Ú_render_stringäs 
zStylerRenderer._render_stringcCsF|j ¡|j ¡|j ¡|}|jD]\}}}||ƒ||Ž}q(|S)a
        Execute the style functions built up in `self._todo`.
 
        Relies on the conventions that all style functions go through
        .apply or .applymap. The append styles to apply as tuples of
 
        (application method, *args, **kwargs)
        )rdÚclearrerfrh)rmrÚfuncÚargsrŠr-r-r.rvós    
 
 
zStylerRenderer._computerƒzlist[dict] | None)rpÚ sparse_colsrrrsrJr|cCsÚ|dkr g}||jd<|jt|jp$gƒ|jdœ}tdƒ}|r@|ntdƒ}|rP|ntdƒ}tt|jj    ƒt|jj
ƒ|||ƒ\}}t t ƒ|_ | ||¡}    | d|    i¡t|j    |||jƒ}
| d|
i¡t t ƒ|_t t ƒ|_| |
||¡} | d    | i¡d
d d d œ} |  ¡D]0\} }dd„t||ƒ ¡Dƒ}| | |i¡q|D]<}|d     |d    ¡|d |d¡|d |d¡q:|j}tdƒs²|pd}d|krª| dd¡}n|d7}| d|i¡|jrÖ|j ||¡}|S)aj
        Process Styler data and settings into a dict for template rendering.
 
        Convert data and settings from ``Styler`` attributes such as ``self.data``,
        ``self.tooltips`` including applying any methods in ``self._todo``.
 
        Parameters
        ----------
        sparse_index : bool
            Whether to sparsify the index or print all hierarchical index elements.
            Upstream defaults are typically to `pandas.options.styler.sparse.index`.
        sparse_cols : bool
            Whether to sparsify the columns or print all hierarchical column elements.
            Upstream defaults are typically to `pandas.options.styler.sparse.columns`.
        max_rows, max_cols : int, optional
            Specific max rows and cols. max_elements always take precedence in render.
        blank : str
            Entry to top-left blank cells.
        dxs : list[dict]
            The render dicts of the concatenated Stylers.
 
        Returns
        -------
        d : dict
            The following structure: {uuid, table_styles, caption, head, body,
            cellstyle, table_attributes}
        NÚ blank_value)r9r;r=zstyler.render.max_elementszstyler.render.max_rowszstyler.render.max_columnsÚheadÚ index_lengthsÚbodyÚ cellstyle_mapÚcellstyle_map_indexÚcellstyle_map_columns)Ú    cellstyleÚcellstyle_indexZcellstyle_columnscSsg|]\}}t|ƒ|dœ‘qS))r(Ú    selectors)rc)Ú.0r(r¥r-r-r.Ú
<listcomp>Ysÿz-StylerRenderer._translate.<locals>.<listcomp>r£r¤zstyler.html.mathjaxrozclass="zclass="tex2jax_ignore z class="tex2jax_ignore"r<)rZr9Úformat_table_stylesr;r=rÚ_get_trimming_maximumsrYr8rUrVrrcr¢Ú_translate_headerr„Ú_get_level_lengthsrar r¡Ú_translate_bodyrzÚgetattrÚextendr<Úreplacerir{)rmrpr›rrrsrJr|r‚Ú max_elementsrÚ idx_lengthsrŸZctx_mapsÚkÚattrÚmapr~Z
table_attrr-r-r.r{sx$
 ý
 
û
þ ÿÿþý þÿ
 
 
zStylerRenderer._translate)Ú sparsify_colsrsc
CsÊt|j|||jƒ}|jj ¡}|jjjdkr:dd„|Dƒ}tt|Žƒ}g}t|j    ƒD].\}}|sT|sfqT| 
||f||¡}|  |¡qT|jj j rÆtj|jj j ŽrÆt|jƒsÆ|jsÆ| |||¡}    |  |    ¡|S)aN
        Build each <tr> within table <head> as a list
 
        Using the structure:
             +----------------------------+---------------+---------------------------+
             |  index_blanks ...          | column_name_0 |  column_headers (level_0) |
          1) |       ..                   |       ..      |             ..            |
             |  index_blanks ...          | column_name_n |  column_headers (level_n) |
             +----------------------------+---------------+---------------------------+
          2) |  index_names (level_0 to level_n) ...      | column_blanks ...         |
             +----------------------------+---------------+---------------------------+
 
        Parameters
        ----------
        sparsify_cols : bool
            Whether column_headers section will add colspan attributes (>1) to elements.
        max_cols : int
            Maximum number of columns to render. If exceeded will contain `...` filler.
 
        Returns
        -------
        head : list
            The associated HTML elements needed for template rendering.
        écSsg|]
}|g‘qSr-r-©r¦Úxr-r-r.r§”sz4StylerRenderer._translate_header.<locals>.<listcomp>)r«rVrbr8Útolistr^rcÚziprwr`Ú_generate_col_header_rowryrUÚnamesÚcomZ any_not_noneÚallr_r\Ú_generate_index_names_row)
rmrµrsÚ col_lengthsÚclabelsrrZhideZ
header_rowZindex_names_rowr-r-r.rªtsFÿ  ÿ ÿþýüÿ
z StylerRenderer._translate_headerÚtupleÚdict)ÚiterrsrÀcCs‚|\}}td|jd|jddƒg|jjt|jƒd}|jjj|}td|dkrr|jd›d|jd›|›n|jd    ›d|jd›|›|dk    r |j    s |n|jdt
|jƒ ƒg}g}    d
}
t ||ƒD]¦\} } t | ||ƒ} | rú|
|  || fd
¡7}
| |
||    d|jd ›d|jd›|›d|jd ›¡r:qvtd|jd ›d|jd›|›d|jd ›| ›| | |j|| f| ƒ|  || fd
¡dkr¬d|  || fd
¡›dndd}|jrâ|jd›|›d|jd ›| ›|d<| rj|| f|jkrj|j|| frj|jd›|›d|jd ›| ›|d<|jt|j|| fƒ |jd›|›d|jd ›| ›¡|     |¡qÌ|||    S)aD
        Generate the row containing column headers:
 
         +----------------------------+---------------+---------------------------+
         |  index_blanks ...          | column_name_i |  column_headers (level_i) |
         +----------------------------+---------------+---------------------------+
 
        Parameters
        ----------
        iter : tuple
            Looping variables from outer scope
        max_cols : int
            Permissible number of columns
        col_lengths :
            c
 
        Returns
        -------
        list of elements
        ÚthrJrœTr¶Nú rIrDrrCrGrEú    colspan="ú"ro©Ú display_valueÚ
attributesÚ_Úid)Ú_elementrZrUr^Úsumr_r8rVr¼r]r¾rwÚ _is_visibleÚgetÚ _check_trimrlr>rfr¢rÂry)rmrÄrsrÀrrÁZ index_blanksÚnameZ column_nameZcolumn_headersÚvisible_col_countr€ÚvalueÚheader_element_visibleÚheader_elementr-r-r.r»°srÿþÿ ÿÿ
öÿ (û,ÿô&ÿ þ ý& ÿ z'StylerRenderer._generate_col_header_rowc sì|}‡fdd„tˆjjjƒDƒ}g}d}|räˆjjd}t||ƒD]ž\}    }
t|    ||ƒ} | rd|d7}ˆ |||dˆjd›dˆjd›|    ›dˆjd    ›ˆjd
¡r¨qä|     t
dˆjd›dˆjd›|    ›ˆjd
|    ˆj kƒ¡qD||S) a
        Generate the row containing index names
 
         +----------------------------+---------------+---------------------------+
         |  index_names (level_0 to level_n) ...      | column_blanks ...         |
         +----------------------------+---------------+---------------------------+
 
        Parameters
        ----------
        iter : tuple
            Looping variables from outer scope
        max_cols : int
            Permissible number of columns
 
        Returns
        -------
        list of elements
        csRg|]J\}}tdˆjd›dˆjd›|›|dkr>ˆjdn|ˆj| ƒ‘qS)rÅrDrÆrINrœ©rÎrZr_)r¦r€rÓ©rmr-r.r§#sú
üz<StylerRenderer._generate_index_names_row.<locals>.<listcomp>rr¶rÅrJrÆrErGrœ) rwr8rUr¼rVr^rÐrÒrZryrÎrb) rmrÄrsrÀrÁZ index_namesZ column_blanksrÔZ
last_levelr€rÕrÖr-rÙr.r¿ s<
 ù
  (úüÿ    z(StylerRenderer._generate_index_names_row)r±rrrsc
s”ˆjj ¡}tˆjjtƒs(dd„|Dƒ}g}d}‡fdd„tˆj ¡ƒDƒD]B\}}|d7}ˆ |||d¡rpqˆ |||f||¡}    |     |    ¡qL|S)aó
        Build each <tr> within table <body> as a list
 
        Use the following structure:
          +--------------------------------------------+---------------------------+
          |  index_header_0    ...    index_header_n   |  data_by_column   ...     |
          +--------------------------------------------+---------------------------+
 
        Also add elements to the cellstyle_map for more efficient grouped elements in
        <style></style> block
 
        Parameters
        ----------
        sparsify_index : bool
            Whether index_headers section will add rowspan attributes (>1) to elements.
 
        Returns
        -------
        body : list
            The associated HTML elements needed for template rendering.
        cSsg|]
}|g‘qSr-r-r·r-r-r.r§bsz2StylerRenderer._translate_body.<locals>.<listcomp>rcsg|]}|dˆjkr|‘qS©r©ra)r¦ÚzrÙr-r.r§fsr¶rF)
r8rUr¹rSrrwZ
itertuplesrÒÚ_generate_body_rowry)
rmr±rrrsÚrlabelsrŸÚvisible_row_countrÚrow_tupZbody_rowr-rÙr.r¬Js. 
 ÿüÿ zStylerRenderer._translate_bodyú...rc)ÚcountÚmaxÚobjÚelementrZrÕr@c    CsB||kr>|dkr"| | |¡¡n| t|||ddd¡dSdS)aÿ
        Indicates whether to break render loops and append a trimming indicator
 
        Parameters
        ----------
        count : int
            The loop count of previous visible items.
        max : int
            The allowable rendered items in the loop.
        obj : list
            The current render collection of the rendered items.
        element : str
            The type of element to append in the case a trimming indicator is needed.
        css : str, optional
            The css to add to the trimming indicator element.
        value : str, optional
            The value of the elements display if necessary.
 
        Returns
        -------
        result : bool
            Whether a trimming element was required and appended.
        rFTro©rËF)ryÚ_generate_trimmed_rowrÎ)rmrârãrärårZrÕr-r-r.rÒxs  zStylerRenderer._check_trim)rsr@c ṡfdd„tˆjjjƒDƒ}g}d}tˆjƒD]”\}}|ˆjk}|rL|d7}ˆ |||dˆjd›dˆjd›dˆjd    ›¡r„qÄ|     t
dˆjd›dˆjd
›|›dˆjd›d |d d ¡q.||S)zÿ
        When a render has too many rows we generate a trimming row containing "..."
 
        Parameters
        ----------
        max_cols : int
            Number of permissible columns
 
        Returns
        -------
        list of elements
        c sLg|]D}tdˆjd›dˆjd›|›dˆjd›dˆj| dd‘qS)rÅrBrÆrIrHrárorærØ)r¦r€rÙr-r.r§­s ö(
øz8StylerRenderer._generate_trimmed_row.<locals>.<listcomp>rr¶Útdr8rÆrHrGrErároræ) Úranger8rUr^rwrVrbrÒrZryrÎ)rmrsÚ index_headersr8rÔr€rÌÚdata_element_visibler-rÙr.rç s6
õ
$û(ûÿ
z$StylerRenderer._generate_trimmed_row)rÄrsr±cCs<|\}}}g}t||ƒD]V\}}    t|||ƒo:|j| }
td|jd›d|jd›|›d|jd›|›|    |
|j||f|    ƒ| ||fd¡dkr¬d| ||fd¡›d    nd
d } |jrà|jd›|›d |jd›|›| d <|
rh||f|jkrh|j||frh|jd›|›d |jd›|›| d <|j    t
|j||fƒ  |jd›|›d |jd›|›¡|  | ¡qg} d} t|dd…ƒD]¤\}}    ||j koª||j k}|rº| d7} | | || d|jd›d|jd›|›d|jd›¡rúq4d
}||f|jkr d|j||f}td|jd›d|jd›|›d|jd›|›|›|    |d
|j||f|    ƒd}|jrž|jd›|›d |jd›|›|d <|r&||f|jkr&|j||fr&|jd›|›d |jd›|›|d <|jt
|j||fƒ  |jd›|›d |jd›|›¡|   |¡qŒ|| S)a¿
        Generate a regular row for the body section of appropriate format.
 
          +--------------------------------------------+---------------------------+
          |  index_header_0    ...    index_header_n   |  data_by_column   ...     |
          +--------------------------------------------+---------------------------+
 
        Parameters
        ----------
        iter : tuple
            Iterable from outer scope: row number, row data tuple, row index labels.
        max_cols : int
            Number of permissible columns.
        idx_lengths : dict
            A map of the sparsification structure of the index
 
        Returns
        -------
            list of elements
        rÅrBrÆrIrFrr¶ú    rowspan="rÈrorÉrÌrÍNrèr8rGrE)rËrÊ)rwrÐr_rÎrZrkrÑr>rer¡rÂryrbrarÒrgrjrdr )rmrÄrsr±rràrÞrêr€rÕrÖr×r8rÔrëÚclsZ data_elementr-r-r.rÝÖs„
ÿ,ÿô þÿÿ þ ý& ÿ ÿ(û0÷ &&& ÿz!StylerRenderer._generate_body_row)r‚rŒr@c    sìˆjj}|tˆjƒ‰‡‡fdd„t|dƒDƒ|d<‡fdd„‰‡fdd„}g}t|ˆƒ|dƒD]f\‰}tˆjƒr|g}n ‡‡fd    d„t|d
|…ƒDƒ}‡‡fd d„t||d
…ƒDƒ}| ||¡qd||d<|d krìtd |›dƒ‚|d
k    rèd|kr|drt    |ƒnd}    t
t ƒ|d<‡fdd„t t    ˆj jƒƒDƒ}
‡fdd„t |ƒDƒ} t|
ƒD]ˆ\} ‰t| ƒD]t\} }||dkr’d|kr’qn|d |ˆfd
¡}|d
k    rn|d| | d| d›dt    | ƒ|    ›d¡qnq^d
S)aÈ
        Post-process the default render dict for the LaTeX template format.
 
        Processing items included are:
          - Remove hidden columns from the non-headers part of the body.
          - Place cellstyles directly in td cells rather than use cellstyle_map.
          - Remove hidden indexes or reinsert missing th elements if part of multiindex
            or multirow sparsification (so that \multirow and \multicol work correctly).
        cs*g|]"\‰}‡‡‡fdd„t|ƒDƒ‘qS)cs2g|]*\}}|dr|dˆjˆ|ˆfi–‘qS)Ú
is_visibler£)rf©r¦r€rE)rrmÚvisible_index_level_nr-r.r§Tsþz>StylerRenderer._translate_latex.<locals>.<listcomp>.<listcomp>)rw)r¦rF)rmrð)rr.r§Ssûþz3StylerRenderer._translate_latex.<locals>.<listcomp>rcsN| ‡‡fdd„ttˆjƒƒDƒ¡ˆtˆjƒ7‰ˆjD]}ˆ|ˆ|ƒ‰q8ˆS)z`
            Extract all visible row indices recursively from concatenated stylers.
            csg|]}|ˆjkr|ˆ‘qSr-rÛ©r¦r©Únrär-r.r§as
zWStylerRenderer._translate_latex.<locals>._concatenated_visible_rows.<locals>.<listcomp>)r®rérYrUr[)räróÚ row_indicesr[©Ú_concatenated_visible_rowsròr.rö\sÿ
zCStylerRenderer._translate_latex.<locals>._concatenated_visible_rowscsg}ˆ|d|ƒ|S©Nrr-)rärôrõr-r.Úconcatenated_visible_rowshs zBStylerRenderer._translate_latex.<locals>.concatenated_visible_rowsrŸcsNg|]F\}}|ddkrˆj|s||dr4|dndˆjˆ|fdœ–‘qS)ÚtyperÅrîrÊro)rÊr£)r_rerï©rrmr-r.r§ws
ùÿ
 ûNcs:g|]2\}}|dr|ddkr|dˆjˆ|fi–‘qS)rîrùrèr£)rdrïrúr-r.r§ƒs þ)Nzall;dataz    all;indexzskip-last;datazskip-last;indexz`clines` value of zj is invalid. Should either be None or one of 'all;data', 'all;index', 'skip-last;data', 'skip-last;index'.r8rrŒcsg|]}|ˆjkr|‘qSr-rÛrñrÙr-r.r§s
csg|]}ˆj|s|‘qSr-)r_©r¦r}rÙr-r.r§ s
r¶z    skip-lastržz\cline{ú-Ú})rUr^rÏr_rwrºr¾ryÚ
ValueErrorrYrrcrér8rÑ)rmr‚rŒZ index_levelsrørŸrFZrow_body_headersZrow_body_cellsZdata_lenZvisible_row_indexesZvisible_index_levelsÚrnZlvlnÚlvlZidx_lenr-)rörrmrðr.rŽGsR
 
ú
     
 ø þ
ÿ
  
ÿ
ÿ
ÿzStylerRenderer._translate_latexÚ.zExtFormatter | Nonez Subset | None)    Ú    formatterÚsubsetÚna_repr?ÚdecimalÚ    thousandsr#Ú
hyperlinksr@c    
sðtˆdk|dk|dk|dk|dk|dk|dk|dkfƒrF|j ¡|S|dkrVtdƒn|}t|ƒ}|jj|}    tˆtƒsŒ‡fdd„|    j    Dƒ‰|j     
|    j    ¡}
|j  
|    j ¡} |
D]>} t ˆ  |j    | ¡||||||d} | D]}| |j|| f<qÖq¬|S)uL
        Format the text display value of cells.
 
        Parameters
        ----------
        formatter : str, callable, dict or None
            Object to define how values are displayed. See notes.
        subset : label, array-like, IndexSlice, optional
            A valid 2d input to `DataFrame.loc[<subset>]`, or, in the case of a 1d input
            or single key, to `DataFrame.loc[:, <subset>]` where the columns are
            prioritised, to limit ``data`` to *before* applying the function.
        na_rep : str, optional
            Representation for missing values.
            If ``na_rep`` is None, no special formatting is applied.
        precision : int, optional
            Floating point precision to use for display purposes, if not determined by
            the specified ``formatter``.
 
            .. versionadded:: 1.3.0
 
        decimal : str, default "."
            Character used as decimal separator for floats, complex and integers.
 
            .. versionadded:: 1.3.0
 
        thousands : str, optional, default None
            Character used as thousands separator for floats, complex and integers.
 
            .. versionadded:: 1.3.0
 
        escape : str, optional
            Use 'html' to replace the characters ``&``, ``<``, ``>``, ``'``, and ``"``
            in cell display string with HTML-safe sequences.
            Use 'latex' to replace the characters ``&``, ``%``, ``$``, ``#``, ``_``,
            ``{``, ``}``, ``~``, ``^``, and ``\`` in the cell display string with
            LaTeX-safe sequences.
            Escaping is done before ``formatter``.
 
            .. versionadded:: 1.3.0
 
        hyperlinks : {"html", "latex"}, optional
            Convert string patterns containing https://, http://, ftp:// or www. to
            HTML <a> tags as clickable URL hyperlinks if "html", or LaTeX \href
            commands if "latex".
 
            .. versionadded:: 1.4.0
 
        Returns
        -------
        Styler
 
        See Also
        --------
        Styler.format_index: Format the text display value of index labels.
 
        Notes
        -----
        This method assigns a formatting function, ``formatter``, to each cell in the
        DataFrame. If ``formatter`` is ``None``, then the default formatter is used.
        If a callable then that function should take a data value as input and return
        a displayable representation, such as a string. If ``formatter`` is
        given as a string this is assumed to be a valid Python format specification
        and is wrapped to a callable as ``string.format(x)``. If a ``dict`` is given,
        keys should correspond to column names, and values should be string or
        callable, as above.
 
        The default formatter currently expresses floats and complex numbers with the
        pandas display precision unless using the ``precision`` argument here. The
        default formatter does not adjust the representation of missing values unless
        the ``na_rep`` argument is used.
 
        The ``subset`` argument defines which region to apply the formatting function
        to. If the ``formatter`` argument is given in dict form but does not include
        all columns within the subset then these columns will have the default formatter
        applied. Any columns in the formatter dict excluded from the subset will
        be ignored.
 
        When using a ``formatter`` string the dtypes must be compatible, otherwise a
        `ValueError` will be raised.
 
        When instantiating a Styler, default formatting can be applied be setting the
        ``pandas.options``:
 
          - ``styler.format.formatter``: default None.
          - ``styler.format.na_rep``: default None.
          - ``styler.format.precision``: default 6.
          - ``styler.format.decimal``: default ".".
          - ``styler.format.thousands``: default None.
          - ``styler.format.escape``: default None.
 
        .. warning::
           `Styler.format` is ignored when using the output format `Styler.to_excel`,
           since Excel and Python have inherrently different formatting structures.
           However, it is possible to use the `number-format` pseudo CSS attribute
           to force Excel permissible formatting. See examples.
 
        Examples
        --------
        Using ``na_rep`` and ``precision`` with the default ``formatter``
 
        >>> df = pd.DataFrame([[np.nan, 1.0, 'A'], [2.0, np.nan, 3.0]])
        >>> df.style.format(na_rep='MISS', precision=3)  # doctest: +SKIP
                0       1       2
        0    MISS   1.000       A
        1   2.000    MISS   3.000
 
        Using a ``formatter`` specification on consistent column dtypes
 
        >>> df.style.format('{:.2f}', na_rep='MISS', subset=[0,1])  # doctest: +SKIP
                0      1          2
        0    MISS   1.00          A
        1    2.00   MISS   3.000000
 
        Using the default ``formatter`` for unspecified columns
 
        >>> df.style.format({0: '{:.2f}', 1: '£ {:.1f}'}, na_rep='MISS', precision=1)
        ...  # doctest: +SKIP
                 0      1     2
        0    MISS   Â£ 1.0     A
        1    2.00    MISS   3.0
 
        Multiple ``na_rep`` or ``precision`` specifications under the default
        ``formatter``.
 
        >>> (df.style.format(na_rep='MISS', precision=1, subset=[0])
        ...     .format(na_rep='PASS', precision=2, subset=[1, 2]))  # doctest: +SKIP
                0      1      2
        0    MISS   1.00      A
        1     2.0   PASS   3.00
 
        Using a callable ``formatter`` function.
 
        >>> func = lambda s: 'STRING' if isinstance(s, str) else 'FLOAT'
        >>> df.style.format({0: '{:.1f}', 2: func}, precision=4, na_rep='MISS')
        ...  # doctest: +SKIP
                0        1        2
        0    MISS   1.0000   STRING
        1     2.0     MISS    FLOAT
 
        Using a ``formatter`` with HTML ``escape`` and ``na_rep``.
 
        >>> df = pd.DataFrame([['<div></div>', '"A&B"', None]])
        >>> s = df.style.format(
        ...     '<a href="a.com/{0}">{0}</a>', escape="html", na_rep="NA"
        ...     )
        >>> s.to_html()  # doctest: +SKIP
        ...
        <td .. ><a href="a.com/&lt;div&gt;&lt;/div&gt;">&lt;div&gt;&lt;/div&gt;</a></td>
        <td .. ><a href="a.com/&#34;A&amp;B&#34;">&#34;A&amp;B&#34;</a></td>
        <td .. >NA</td>
        ...
 
        Using a ``formatter`` with LaTeX ``escape``.
 
        >>> df = pd.DataFrame([["123"], ["~ ^"], ["$%#"]])
        >>> df.style.format("\\textbf{{{}}}", escape="latex").to_latex()
        ...  # doctest: +SKIP
        \begin{tabular}{ll}
        {} & {0} \\
        0 & \textbf{123} \\
        1 & \textbf{\textasciitilde \space \textasciicircum } \\
        2 & \textbf{\$\%\#} \\
        \end{tabular}
 
        Pandas defines a `number-format` pseudo CSS attribute instead of the `.format`
        method to create `to_excel` permissible formatting. Note that semi-colons are
        CSS protected characters but used as separators in Excel's format string.
        Replace semi-colons with the section separator character (ASCII-245) when
        defining the formatting here.
 
        >>> df = pd.DataFrame({"A": [1, 0, -1]})
        >>> pseudo_css = "number-format: 0§[Red](0)§-§@;"
        >>> filename = "formatted_file.xlsx"
        >>> df.style.applymap(lambda v: pseudo_css).to_excel(filename) # doctest: +SKIP
 
        .. figure:: ../../_static/style/format_excel_css.png
        Nrcsi|]
}|ˆ“qSr-r-)r¦rE©rr-r.Ú
<dictcomp>}sz)StylerRenderer.format.<locals>.<dictcomp>©rr?rrr#r)r¾rjr˜ÚsliceÚnon_reducing_slicer8ÚlocrSrÃrVZget_indexer_forrUÚ_maybe_wrap_formatterrÑ)rmrrrr?rrr#rr8ZcisZrisÚciÚ format_funcÚrir-rr.Úformat­sD=øÿ
 
ù    zStylerRenderer.formatrrúLevel | list[Level] | None)
rÚaxisrIrr?rrr#rr@c
 
s|j ˆ¡‰ˆdkr$|j|j}
‰n|j|j}
‰t|ˆƒ} tˆdk|dk|dk|dk|dk|dk|dk|    dkfƒr€|
 ¡|St    ˆt
ƒsž‡fdd„| Dƒ‰n‡fdd„ˆ  ¡Dƒ‰| D]J‰t ˆ  ˆ¡||||||    d} ‡‡fdd    „ttˆƒƒDƒD] } | |
| <qôq¸|S)
aº
        Format the text display value of index labels or column headers.
 
        .. versionadded:: 1.4.0
 
        Parameters
        ----------
        formatter : str, callable, dict or None
            Object to define how values are displayed. See notes.
        axis : {0, "index", 1, "columns"}
            Whether to apply the formatter to the index or column headers.
        level : int, str, list
            The level(s) over which to apply the generic formatter.
        na_rep : str, optional
            Representation for missing values.
            If ``na_rep`` is None, no special formatting is applied.
        precision : int, optional
            Floating point precision to use for display purposes, if not determined by
            the specified ``formatter``.
        decimal : str, default "."
            Character used as decimal separator for floats, complex and integers.
        thousands : str, optional, default None
            Character used as thousands separator for floats, complex and integers.
        escape : str, optional
            Use 'html' to replace the characters ``&``, ``<``, ``>``, ``'``, and ``"``
            in cell display string with HTML-safe sequences.
            Use 'latex' to replace the characters ``&``, ``%``, ``$``, ``#``, ``_``,
            ``{``, ``}``, ``~``, ``^``, and ``\`` in the cell display string with
            LaTeX-safe sequences.
            Escaping is done before ``formatter``.
        hyperlinks : {"html", "latex"}, optional
            Convert string patterns containing https://, http://, ftp:// or www. to
            HTML <a> tags as clickable URL hyperlinks if "html", or LaTeX \href
            commands if "latex".
 
        Returns
        -------
        Styler
 
        See Also
        --------
        Styler.format: Format the text display value of data cells.
 
        Notes
        -----
        This method assigns a formatting function, ``formatter``, to each level label
        in the DataFrame's index or column headers. If ``formatter`` is ``None``,
        then the default formatter is used.
        If a callable then that function should take a label value as input and return
        a displayable representation, such as a string. If ``formatter`` is
        given as a string this is assumed to be a valid Python format specification
        and is wrapped to a callable as ``string.format(x)``. If a ``dict`` is given,
        keys should correspond to MultiIndex level numbers or names, and values should
        be string or callable, as above.
 
        The default formatter currently expresses floats and complex numbers with the
        pandas display precision unless using the ``precision`` argument here. The
        default formatter does not adjust the representation of missing values unless
        the ``na_rep`` argument is used.
 
        The ``level`` argument defines which levels of a MultiIndex to apply the
        method to. If the ``formatter`` argument is given in dict form but does
        not include all levels within the level argument then these unspecified levels
        will have the default formatter applied. Any levels in the formatter dict
        specifically excluded from the level argument will be ignored.
 
        When using a ``formatter`` string the dtypes must be compatible, otherwise a
        `ValueError` will be raised.
 
        .. warning::
           `Styler.format_index` is ignored when using the output format
           `Styler.to_excel`, since Excel and Python have inherrently different
           formatting structures.
           However, it is possible to use the `number-format` pseudo CSS attribute
           to force Excel permissible formatting. See documentation for `Styler.format`.
 
        Examples
        --------
        Using ``na_rep`` and ``precision`` with the default ``formatter``
 
        >>> df = pd.DataFrame([[1, 2, 3]], columns=[2.0, np.nan, 4.0])
        >>> df.style.format_index(axis=1, na_rep='MISS', precision=3)  # doctest: +SKIP
            2.000    MISS   4.000
        0       1       2       3
 
        Using a ``formatter`` specification on consistent dtypes in a level
 
        >>> df.style.format_index('{:.2f}', axis=1, na_rep='MISS')  # doctest: +SKIP
             2.00   MISS    4.00
        0       1      2       3
 
        Using the default ``formatter`` for unspecified levels
 
        >>> df = pd.DataFrame([[1, 2, 3]],
        ...     columns=pd.MultiIndex.from_arrays([["a", "a", "b"],[2, np.nan, 4]]))
        >>> df.style.format_index({0: lambda v: upper(v)}, axis=1, precision=1)
        ...  # doctest: +SKIP
                       A       B
              2.0    nan     4.0
        0       1      2       3
 
        Using a callable ``formatter`` function.
 
        >>> func = lambda s: 'STRING' if isinstance(s, str) else 'FLOAT'
        >>> df.style.format_index(func, axis=1, na_rep='MISS')
        ...  # doctest: +SKIP
                  STRING  STRING
            FLOAT   MISS   FLOAT
        0       1      2       3
 
        Using a ``formatter`` with HTML ``escape`` and ``na_rep``.
 
        >>> df = pd.DataFrame([[1, 2, 3]], columns=['"A"', 'A&B', None])
        >>> s = df.style.format_index('$ {0}', axis=1, escape="html", na_rep="NA")
        ...  # doctest: +SKIP
        <th .. >$ &#34;A&#34;</th>
        <th .. >$ A&amp;B</th>
        <th .. >NA</td>
        ...
 
        Using a ``formatter`` with LaTeX ``escape``.
 
        >>> df = pd.DataFrame([[1, 2, 3]], columns=["123", "~", "$%#"])
        >>> df.style.format_index("\\textbf{{{}}}", escape="latex", axis=1).to_latex()
        ...  # doctest: +SKIP
        \begin{tabular}{lrrr}
        {} & {\textbf{123}} & {\textbf{\textasciitilde }} & {\textbf{\$\%\#}} \\
        0 & 1 & 2 & 3 \\
        \end{tabular}
        rNrcsi|]
}|ˆ“qSr-r-)r¦rIrr-r.r    5sz/StylerRenderer.format_index.<locals>.<dictcomp>csi|]\}}ˆ |¡|“qSr-)Ú_get_level_number)r¦rIZ
formatter_©rär-r.r    7sÿr
cs$g|]}ˆdkr|ˆfnˆ|f‘qSrÚr-rû)rrr-r.r§Gsz/StylerRenderer.format_index.<locals>.<listcomp>)r8Ú_get_axis_numberrkrUrlrVÚrefactor_levelsr¾r˜rSrÃrzrrÑrérY)rmrrrIrr?rrr#rÚdisplay_funcs_Úlevels_rÚidxr-)rrrrär.Ú format_indexsJ 
øÿ 
 
þù
  zStylerRenderer.format_indexzSequence | Index)ÚlabelsrrIr@csh|j |¡}|dkr2|j|j}}|j|j‰‰n|j|j}}|j|j    ‰‰t
|ƒt
t ˆƒƒ}t
|ƒ|kr~t d|›dƒ‚|dkrž‡fdd„t |jƒDƒ}t||ƒ}dd„}t‡fd    d„t t
|ƒƒDƒƒD]”\}    }
t
|ƒd
kr|dkrú|
|dfn
|d|
f} t|||    d || <qÎt|ƒD]<\} } |dkr>|
| fn| |
f} t|||    | d || <q$qÎ|S) aa
        Relabel the index, or column header, keys to display a set of specified values.
 
        .. versionadded:: 1.5.0
 
        Parameters
        ----------
        labels : list-like or Index
            New labels to display. Must have same length as the underlying values not
            hidden.
        axis : {"index", 0, "columns", 1}
            Apply to the index or columns.
        level : int, str, list, optional
            The level(s) over which to apply the new labels. If `None` will apply
            to all levels of an Index or MultiIndex which are not hidden.
 
        Returns
        -------
        Styler
 
        See Also
        --------
        Styler.format_index: Format the text display value of index or column headers.
        Styler.hide: Hide the index, column headers, or specified data from display.
 
        Notes
        -----
        As part of Styler, this method allows the display of an index to be
        completely user-specified without affecting the underlying DataFrame data,
        index, or column headers. This means that the flexibility of indexing is
        maintained whilst the final display is customisable.
 
        Since Styler is designed to be progressively constructed with method chaining,
        this method is adapted to react to the **currently specified hidden elements**.
        This is useful because it means one does not have to specify all the new
        labels if the majority of an index, or column headers, have already been hidden.
        The following produce equivalent display (note the length of ``labels`` in
        each case).
 
        .. code-block:: python
 
            # relabel first, then hide
            df = pd.DataFrame({"col": ["a", "b", "c"]})
            df.style.relabel_index(["A", "B", "C"]).hide([0,1])
            # hide first, then relabel
            df = pd.DataFrame({"col": ["a", "b", "c"]})
            df.style.hide([0,1]).relabel_index(["C"])
 
        This method should be used, rather than :meth:`Styler.format_index`, in one of
        the following cases (see examples):
 
          - A specified set of labels are required which are not a function of the
            underlying index keys.
          - The function of the underlying index keys requires a counter variable,
            such as those available upon enumeration.
 
        Examples
        --------
        Basic use
 
        >>> df = pd.DataFrame({"col": ["a", "b", "c"]})
        >>> df.style.relabel_index(["A", "B", "C"])  # doctest: +SKIP
             col
        A      a
        B      b
        C      c
 
        Chaining with pre-hidden elements
 
        >>> df.style.hide([0,1]).relabel_index(["C"])  # doctest: +SKIP
             col
        C      c
 
        Using a MultiIndex
 
        >>> midx = pd.MultiIndex.from_product([[0, 1], [0, 1], [0, 1]])
        >>> df = pd.DataFrame({"col": list(range(8))}, index=midx)
        >>> styler = df.style  # doctest: +SKIP
                  col
        0  0  0     0
              1     1
           1  0     2
              1     3
        1  0  0     4
              1     5
           1  0     6
              1     7
        >>> styler.hide((midx.get_level_values(0)==0)|(midx.get_level_values(1)==0))
        ...  # doctest: +SKIP
        >>> styler.hide(level=[0,1])  # doctest: +SKIP
        >>> styler.relabel_index(["binary6", "binary7"])  # doctest: +SKIP
                  col
        binary6     6
        binary7     7
 
        We can also achieve the above by indexing first and then re-labeling
 
        >>> styler = df.loc[[(1,1,0), (1,1,1)]].style
        >>> styler.hide(level=[0,1]).relabel_index(["binary6", "binary7"])
        ...  # doctest: +SKIP
                  col
        binary6     6
        binary7     7
 
        Defining a formatting function which uses an enumeration counter. Also note
        that the value of the index key is passed in the case of string labels so it
        can also be inserted into the label, using curly brackets (or double curly
        brackets if the string if pre-formatted),
 
        >>> df = pd.DataFrame({"samples": np.random.rand(10)})
        >>> styler = df.loc[np.random.randint(0,10,3)].style
        >>> styler.relabel_index([f"sample{i+1} ({{}})" for i in range(3)])
        ...  # doctest: +SKIP
                         samples
        sample1 (5)     0.315811
        sample2 (0)     0.495941
        sample3 (2)     0.067946
        rzS``labels`` must be of length equal to the number of visible labels along ``axis`` (z).Ncsg|]}ˆ|s|‘qSr-r-rû)Ú hidden_lvlsr-r.r§×sz0StylerRenderer.relabel_index.<locals>.<listcomp>cSst|tƒr| |¡S|S©N)rSr%r)r¸rÕr-r-r.Úalias_Ús
 
z,StylerRenderer.relabel_index.<locals>.alias_csg|]}|ˆkr|‘qSr-r-rû)Ú hidden_labelsr-r.r§ßsr¶)rÕ)r8rrkrUrar_rlrVrbr`rYÚsetrþrér^rrwr)rmrrrIrräZ visible_lenrr Zair}rZajrr-)r!rr.Ú relabel_indexLs.|  
ÿ
&"zStylerRenderer.relabel_index)Nr2NNNTN)NNro)NN)NN)NNrƒN)Nrá)NNNNrNNN)    NrNNNrNNN)rN)!r)r*r+Ú__doc__r Z PackageLoaderr1Ú EnvironmentÚenvZ get_templater…r‡rˆrr–rnrxr‹r•r—rvr{rªr»r¿r¬rÒrçrÝrŽrrr#r-r-r-r.r/Ds† 
 
 
 
 
÷ Gú1ûûùp<]=4ù(6qh÷ fö"@ür/r%r3rr5rÃ)Ú html_elementÚ
html_classrÕrîr@cKs"d|kr||d<||||dœ|–S)z]
    Template to return container with information for a <td></td> or <th></th> element.
    rÊ)rùrÕÚclassrîr-)r'r(rÕrîrŠr-r-r.rÎës
üûrÎ皙™™™™é?Úfloatztuple[int, int])Úscaling_factorr@csX‡fdd„}|r ||kr|n|}|r4||kr0|n|}|||krP|||ƒ\}}q4||fS)a:
    Recursively reduce the number of rows and columns to satisfy max elements.
 
    Parameters
    ----------
    rn, cn : int
        The number of input rows / columns
    max_elements : int
        The number of allowable elements
    max_rows, max_cols : int, optional
        Directly specify an initial maximum rows or columns before compression.
    scaling_factor : float
        Factor at which to reduce the number of rows / columns to fit.
 
    Returns
    -------
    rn, cn : tuple
        New rn and cn values that satisfy the max_elements constraint
    cs,||kr|t|ˆƒfSt|ˆƒ|fSdSr)r4)rÿÚcn©r,r-r.Ú
scale_downsz*_get_trimming_maximums.<locals>.scale_downr-)rÿr-r°rrrsr,r/r-r.r.r©s  r©rr4zSequence[int] | None)rUÚsparsifyÚ    max_indexÚhidden_elementscCstt|tƒr|jtjdd}n| ¡}|dkr0g}i}t|tƒsht|ƒD]\}}||krFd|d|f<qF|St|ƒD]ì\}}d}    t|ƒD]Ö\}
} |    |kr˜qp|sº|
|kr¸d|||
f<|    d7}    q„| tjk    ræ|
|kræ|
} d||| f<|    d7}    q„| tjk    r|
} d||| f<q„|
|kr„|    d7}    |    |kr"qp||| fdkrF|
} d||| f<q„||| fd7<q„qpdd„| ¡Dƒ} | S)aZ
    Given an index, find the level length for each element.
 
    Parameters
    ----------
    index : Index
        Index or columns to determine lengths of each element
    sparsify : bool
        Whether to hide or show each distinct element in a MultiIndex
    max_index : int
        The maximum number of elements to analyse along the index due to trimming
    hidden_elements : sequence of int
        Index positions of elements hidden from display in the index affecting
        length
 
    Returns
    -------
    Dict :
        Result is a dictionary of (level, initial_position): span
    F)r0ZadjoinNr¶rcSsi|]\}}|dkr||“qS)r¶r-)r¦råÚlengthr-r-r.r    wsz&_get_level_lengths.<locals>.<dictcomp>)rSrrrZ
no_defaultrwrz)rUr0r1r2ÚlevelsÚlengthsr}rÕrrßÚjrFZ
last_labelZnon_zero_lengthsr-r-r.r«-sN
 
 
 
 
ÿr«©r@cCs ||f|kS)z/
    Index -> {(idx_row, idx_col): bool}).
    r-)Zidx_rowZidx_colr5r-r-r.rÐ~srÐÚ    CSSStyles)Ústylesr@cCsdd„|DƒS)zÒ
    looks for multiple CSS selectors and separates them:
    [{'selector': 'td, th', 'props': 'a:v;'}]
        ---> [{'selector': 'td', 'props': 'a:v;'},
              {'selector': 'th', 'props': 'a:v;'}]
    cSs.g|]&}|d d¡D]}||ddœ‘qqS)r&ú,r(©r&r()Úsplit)r¦Zcss_dictr&r-r-r.r§Œsþz'format_table_styles.<locals>.<listcomp>r-)r9r-r-r.r¨…sþr¨F)r¸r?rr@cCsTt|ƒst|ƒr4|r$|d|›d›S|d|›d›St|ƒrP|rH|d›S|d›S|S)aµ
    Format the display of a value
 
    Parameters
    ----------
    x : Any
        Input variable to be formatted
    precision : Int
        Floating point precision used if ``x`` is float or complex.
    thousands : bool, default False
        Whether to group digits with thousands separated with ",".
 
    Returns
    -------
    value : Any
        Matches input type, or string if input is float or complex or int with sep.
    z,.Úfrz,.0fz.0f)rrr)r¸r?rr-r-r.rP“s
$rPr)rrrr@cs‡‡‡fdd„}|S)zÉ
    Takes a string formatting function and wraps logic to deal with thousands and
    decimal parameters, in the case that they are non-standard and that the input
    is a (float, complex, int).
    cs¨t|ƒst|ƒst|ƒr ˆdkrPˆdk    rPˆdkrPˆ|ƒ dd¡ dˆ¡ dˆ¡Sˆdkrxˆdkshˆdkrxˆ|ƒ dˆ¡Sˆdkr ˆdk    r ˆdkr ˆ|ƒ dˆ¡Sˆ|ƒS)Nrr:u§_§-)rrrr¯©r¸©rrrr-r.Úwrapperµs$ÿþýÿz(_wrap_decimal_thousands.<locals>.wrapperr-)rrrr@r-r?r.Ú_wrap_decimal_thousands¬s    rAcCs<t|tƒr8|dkrt|ƒS|dkr*t|ƒStd|›ƒ‚|S)z/if escaping: only use on str, else return inputÚhtmlÚlatexz2`escape` only permitted in {'html', 'latex'}, got )rSr%Ú escape_htmlÚ _escape_latexrþ)r¸r#r-r-r.Ú _str_escapeÇs
ÿrFcsLt|tƒrH|dkrd‰n|dkr&d‰ntdƒ‚d}t |‡fdd„|¡S|S)    zMuses regex to detect a common URL pattern and converts to href tag in format.rBz%<a href="{0}" target="_blank">{0}</a>rCz\href{{{0}}}{{{0}}}z3``hyperlinks`` format can only be 'html' or 'latex'zE((http|ftp)s?:\/\/|www.)[\w/\-?=%.:@]+\.[\w/\-&?=%.,':;~!@#$*()\[\]]+csˆ | d¡¡Sr÷)rÚgroup)Úm©Úhrefr-r.rQßrRz_render_href.<locals>.<lambda>)rSr%rþÚreÚsub)r¸rÚpatr-rIr.Ú _render_hrefÕs
rNrzBaseFormatter | Noner6)rrr?rrr#rr@csêtˆtƒr‡fdd„‰nPtˆƒr&ˆ‰nBˆdkrV|dkr>tdƒn|}tt||dk    d‰ntdtˆƒ›ƒ‚ˆdk    r€‡‡fdd„}nˆ}|dksœ|dk    r¬|d    kr¬t|||d
‰n|‰ˆdk    rȇ‡fd d„‰nˆ‰ˆdkr؈S‡‡fd d„SdS) zº
    Allows formatters to be expressed as str, callable or None, where None returns
    a default formatting function. wraps with na_rep, and precision where they are
    available.
    cs
ˆ |¡Sr©rr>rr-r.rQórRz'_maybe_wrap_formatter.<locals>.<lambda>NrL)r?rz*'formatter' expected str or callable, got csˆt|ˆdƒS)Nr")rFr>)r#Úfunc_0r-r.rQrRrr:)rrcsˆt|ˆdƒS)NrO)rNr>)Úfunc_2rr-r.rQrRcst|ƒdkrˆSˆ|ƒS)NT)rr>)Úfunc_3rr-r.rQrR)    rSr%ÚcallablerrrPrTrùrA)rrr?rrr#rZfunc_1r-)r#rrPrQrRrrr.rãs2
ÿÿrÚSubset)Úslice_csvttjtttf}t||ƒr*tdd…|f}ddœdd„‰t|ƒs\t|t    ƒsT|gg}qn|g}n‡fdd„|Dƒ}t
|ƒS)z¶
    Ensure that a slice doesn't reduce to a Series or Scalar.
 
    Any user-passed `subset` should have this called on it
    to make sure we're always working with DataFrames.
    Nr5r7cSs2t|tƒrtdd„|DƒƒSt|tƒp,t|ƒSdS)z‹
        Returns
        -------
        bool
            True if slice does *not* reduce,
            False if `part` is a tuple.
        css |]}t|tƒpt|ƒVqdSr)rSr r)r¦Úsr-r-r.Ú    <genexpr>2sz3non_reducing_slice.<locals>.pred.<locals>.<genexpr>N)rSrÂÚanyr r)Úpartr-r-r.Úpred&s
 
z non_reducing_slice.<locals>.predcsg|]}ˆ|ƒr|n|g‘qSr-r-)r¦Úp©rZr-r.r§@sz&non_reducing_slice.<locals>.<listcomp>) rÚnpZndarrayrrcr%rSrrr rÂ)rUÚkindsr-r\r.r s    
 
 
r r'ÚCSSList)Ústyler@cCsNt|tƒrJ| d¡}zdd„|DƒWStk
rHtd|›dƒ‚YnX|S)zÌ
    Convert css-string to sequence of tuples format if needed.
    'color:red; border:1px solid black;' -> [('color', 'red'),
                                             ('border','1px solid red')]
    ú;cSs<g|]4}| ¡dkr| d¡d ¡| d¡d ¡f‘qS)roú:rr¶)Ústripr<r·r-r-r.r§Ms þz/maybe_convert_css_to_tuples.<locals>.<listcomp>zSStyles supplied as string must follow CSS rule formats, for example 'attr: val;'. 'z ' was given.)rSr%r<Ú
IndexErrorrþ)r`rVr-r-r.Úmaybe_convert_css_to_tuplesDs
 
þ
ÿ
rerz    list[int])rIrär@csl|dkrttˆjƒƒ}nPt|tƒr*|g}n>t|tƒrBˆ |¡g}n&t|tƒr`‡fdd„|Dƒ}ntdƒ‚|S)aX
    Returns a consistent levels arg for use in ``hide_index`` or ``hide_columns``.
 
    Parameters
    ----------
    level : int, str, list
        Original ``level`` arg supplied to above methods.
    obj:
        Either ``self.index`` or ``self.columns``
 
    Returns
    -------
    list : refactored arg with a list of levels to hide
    Ncs$g|]}t|tƒsˆ |¡n|‘qSr-)rSr4r)r¦Zlevrr-r.r§ssÿz#refactor_levels.<locals>.<listcomp>z4`level` must be of type `int`, `str` or list of such)rcrér^rSr4r%rrþ)rIrärr-rr.rZs
 
 
 
þrc@sleZdZdZddddddgdeƒfd    d
d d d œdd„Zedd„ƒZd
d
ddd
dœdd„Zdddœdd„Z    dS)ÚTooltipsa
    An extension to ``Styler`` that allows for and manipulates tooltips on hover
    of ``<td>`` cells in the HTML result.
 
    Parameters
    ----------
    css_name: str, default "pd-t"
        Name of the CSS class that controls visualisation of tooltips.
    css_props: list-like, default; see Notes
        List of (attr, value) tuples defining properties of the CSS class.
    tooltips: DataFrame, default empty
        DataFrame of strings aligned with underlying Styler data for tooltip
        display.
 
    Notes
    -----
    The default properties for the tooltip CSS class are:
 
        - visibility: hidden
        - position: absolute
        - z-index: 1
        - background-color: black
        - color: white
        - transform: translate(-20px, -20px)
 
    Hidden visibility is a key prerequisite to the hover functionality, and should
    always be included in any manual properties specification.
    )Ú
visibilityÚhidden)ÚpositionÚabsolute)zz-indexr¶)úbackground-colorZblack)ÚcolorZwhite)Z    transformztranslate(-20px, -20px)zpd-tr'r%rr7)Ú    css_propsÚcss_namerir@cCs||_||_||_g|_dSr)Ú
class_nameÚclass_propertiesÚtt_datar;)rmrmrnrir-r-r.rnšs zTooltips.__init__cCsd|j›t|jƒdœgS)a
        Combine the ``_Tooltips`` CSS class name and CSS properties to the format
        required to extend the underlying ``Styler`` `table_styles` to allow
        tooltips to render in HTML.
 
        Returns
        -------
        styles : List
        rr;)rorerprÙr-r-r.Ú _class_styles¬s
þÿzTooltips._class_stylesr4)r9rÓrFrEÚtextcCsZd|dt|ƒdt|ƒ}|d|›dgdœ|d|›dd    d
|›d
fgdœgS) a:
        For every table data-cell that has a valid tooltip (not None, NaN or
        empty string) must create two pseudo CSS entries for the specific
        <td> element id which are added to overall table styles:
        an on hover visibility change and a content change
        dependent upon the user's chosen display string.
 
        For example:
            [{"selector": "T__row1_col1:hover .pd-t",
             "props": [("visibility", "visible")]},
            {"selector": "T__row1_col1 .pd-t::after",
             "props": [("content", "Some Valid Text String")]}]
 
        Parameters
        ----------
        uuid: str
            The uuid of the Styler instance
        name: str
            The css-name of the class used for styling tooltips
        row : int
            The row index of the specified tooltip string data
        col : int
            The col index of the specified tooltip string data
        text : str
            The textual content of the tooltip to be displayed in HTML.
 
        Returns
        -------
        pseudo_css : List
        z#T_ruZ_colz:hover .)rgZvisibler;z .z::afterÚcontentrÈ)r%)rmr9rÓrFrErsZ selector_idr-r-r.Ú _pseudo_css¾s  þþûzTooltips._pseudo_cssr/rÃ)Ústylerr‚csԈj ˆj¡ˆ_ˆjjr|Sˆj‰ˆj ¡ˆj d¡B‰dd„‡‡‡‡fdd„ttˆjj    ƒƒDƒDƒˆ_
ˆj
rÐ|dD]8}|D].}|ddkr~t |dƒd    ˆj›d
|d<q~qv|d   ˆj ¡|d   ˆj
¡|S) a=
        Mutate the render dictionary to allow for tooltips:
 
        - Add ``<span>`` HTML element to each data cells ``display_value``. Ignores
          headers.
        - Add table level CSS styles to control pseudo classes.
 
        Parameters
        ----------
        styler_data : DataFrame
            Underlying ``Styler`` DataFrame used for reindexing.
        uuid : str
            The underlying ``Styler`` uuid for CSS id.
        d : dict
            The dictionary prior to final render
 
        Returns
        -------
        render_dict : Dict
        rocSsg|]}|D]}|‘q qSr-r-)r¦Zsublistr`r-r-r.r§s
õz'Tooltips._translate.<locals>.<listcomp>c shg|]`}ttˆjjƒƒD]J}ˆj||fs|ˆjks|ˆjksˆ ˆjˆ||t    ˆjj||fƒ¡‘qqSr-)
rérYrqrVZilocrarbrur9r%)r¦r}r6©ÚmaskrÓrmrvr-r.r§s
 
úrŸrùrèrÊz <span class="z    "></span>r;)rqZ reindex_liker8ÚemptyrorÚeqrérYrUr;r%r®rr)rmrvr‚rFÚitemr-rwr.r{és*þþ  
 ÿÿ
zTooltips._translateN)
r)r*r+r$rrnÚpropertyrrrur{r-r-r-r.rf|s úõ
+rf)r;r=r@cs2ddddg‰|dk    r*t‡fdd„|Dƒƒp0|dk    S)a8
    Indicate whether LaTeX {tabular} should be wrapped with a {table} environment.
 
    Parses the `table_styles` and detects any selectors which must be included outside
    of {tabular}, i.e. indicating that wrapping must occur, and therefore return True,
    or if a caption exists and requires similar.
    ZtopruleZmidruleZ
bottomruleZ column_formatNc3s|]}|dˆkVqdS)r&Nr-)r¦r‚©ZIGNORED_WRAPPERSr-r.rW.sz._parse_latex_table_wrapping.<locals>.<genexpr>)rX)r;r=r-r}r.r"s  þýr)r;r&r@cCsD|ddd…D]0}|d|krt|dddƒ dd¡SqdS)    uy
    Return the first 'props' 'value' from ``tables_styles`` identified by ``selector``.
 
    Examples
    --------
    >>> table_styles = [{'selector': 'foo', 'props': [('attr','value')]},
    ...                 {'selector': 'bar', 'props': [('attr', 'overwritten')]},
    ...                 {'selector': 'bar', 'props': [('a1', 'baz'), ('a2', 'ignore')]}]
    >>> _parse_latex_table_styles(table_styles, selector='bar')
    'baz'
 
    Notes
    -----
    The replacement of "§" with ":" is to avoid the CSS problem where ":" has structural
    significance and cannot be used in LaTeX labels, but is often required by them.
    Néÿÿÿÿr&r(rr¶õ§rb)r%r¯)r;r&r`r-r-r.r’2s "r’)Ú latex_stylesrÊÚ convert_cssr@c
CsÀ|r t|ƒ}|ddd…D] \}}d|›d|›dd|›d|›d|›d|›d|›d|›dd|›d    |›dd
œ}d|›|›d |›}d D],}|t|ƒkrŒ|| d t||d¡}qqŒq|S)a•
    Mutate the ``display_value`` string including LaTeX commands from ``latex_styles``.
 
    This method builds a recursive latex chain of commands based on the
    CSSList input, nested around ``display_value``.
 
    If a CSS style is given as ('<command>', '<options>') this is translated to
    '\<command><options>{display_value}', and this value is treated as the
    display value for the next iteration.
 
    The most recent style forms the inner component, for example for styles:
    `[('c1', 'o1'), ('c2', 'o2')]` this returns: `\c1o1{\c2o2{display_value}}`
 
    Sometimes latex commands have to be wrapped with curly braces in different ways:
    We create some parsing flags to identify the different behaviours:
 
     - `--rwrap`        : `\<command><options>{<display_value>}`
     - `--wrap`         : `{\<command><options> <display_value>}`
     - `--nowrap`       : `\<command><options> <display_value>`
     - `--lwrap`        : `{\<command><options>} <display_value>`
     - `--dwrap`        : `{\<command><options>}{<display_value>}`
 
    For example for styles:
    `[('c1', 'o1--wrap'), ('c2', 'o2')]` this returns: `{\c1o1 \c2o2{display_value}}
    Nr~z{\z --to_parse rýú\z --to_parse} z --to_parse{z --to_parse}{)ú--wrapú--nowrapú--lwrapú--rwrapú--dwraprÆ)r„rƒr…r†r‡z
--to_parse©rÕÚarg)Ú_parse_latex_css_conversionr%r¯Ú_parse_latex_options_strip)r€rÊrÚcommandÚoptionsrr‰r-r-r.r“Is$û 
ÿr“zdict[str, Any])ÚcellÚmultirow_alignÚmulticol_alignÚwraprr@c Cs\t|d|d|ƒ}d|krB|d}d|kræ|| d¡dd…}t|d| d¡…ƒ}d|kr”|rrd    |›d
n|›}|r€d nd }    ||    |d Sd|krÎ|r¬d    |›d
n|›}|rºdnd}    |    |d |Sd|›d|›d|›d
Sd|krB|dkrþ|S|| d¡dd…}
t|
d|
 d¡…ƒ}
d|›d|
›d|›d
S|rTd    |›d
S|SdS)aè
    Refactor the cell `display_value` if a 'colspan' or 'rowspan' attribute is present.
 
    'rowspan' and 'colspan' do not occur simultaneouly. If they are detected then
    the `display_value` is altered to a LaTeX `multirow` or `multicol` command
    respectively, with the appropriate cell-span.
 
    ``wrap`` is used to enclose the `display_value` in braces which is needed for
    column headers using an siunitx package.
 
    Requires the package {multirow}, whereas multicol support is usually built in
    to the {tabular} environment.
 
    Examples
    --------
    >>> cell = {'cellstyle': '', 'display_value':'text', 'attributes': 'colspan="3"'}
    >>> _parse_latex_header_span(cell, 't', 'c')
    '\\multicolumn{3}{c}{text}'
    r£rÊrËrÇé    NrÈznaive-lÚ{rýz & {}z &r¶znaive-rz{} & z& z \multicolumn{z}{rìZnaivez
\multirow[z]{z}{*}{)r“Úfindr4) rŽrrr‘rZ display_valÚattrsZcolspanÚoutZblanksZrowspanr-r-r.r”ys8ÿ
 
 
 r”z str | float)rÕr‰r@cCs$t|ƒ |d¡ dd¡ dd¡ ¡S)zÐ
    Strip a css_value which may have latex wrapping arguments, css comment identifiers,
    and whitespaces, to a valid string for latex options parsing.
 
    For example: 'red /* --wrap */  ' --> 'red'
    roz/*z*/)r%r¯rcrˆr-r-r.r‹°sr‹c CsÐdd„}dd„}dd„}|t|ddd    t|d
d d    |d œ}g}|D]ˆ\}}t|tƒrrd |krr| || d d ¡f¡||krBd }dD]$}    |    t|ƒkr‚|    t||    ƒ}}q¨q‚||||ƒ}
|
dk    rB| |
g¡qB|S)z²
    Convert CSS (attribute,value) pairs to equivalent LaTeX (command,options) pairs.
 
    Ignore conversion if tagged with `--latex` option, skipped if no conversion found.
    cSs|dkrd|›fSdS)N)ZboldZbolderZbfseriesr-rˆr-r-r.Ú font_weightÁs
z0_parse_latex_css_conversion.<locals>.font_weightcSs(|dkrd|›fS|dkr$d|›fSdS)NZitalicZitshapeZobliqueZslshaper-rˆr-r-r.Ú
font_styleÆs
 
 
z/_parse_latex_css_conversion.<locals>.font_stylec        SsÔ|dkr |n|}|ddkrHt|ƒdkrH|d|dd… ¡›d|›fS|ddkr¨t|ƒd    kr¨|d ¡d
›|d
 ¡d
›|d  ¡d
›}|d|›d|›fS|dd …d kr¼t d |¡d ¡}d|krêt|dd…ƒdn
t|ƒd}t d|¡d ¡}d|kr(t|dd…ƒdn
t|ƒd}|d dkrXt d|¡d ¡}nt d|¡d ¡}d|krŠt|dd…ƒdn
t|ƒd}|d|d›d|d›d|d›d|›fS|d|›d|›fSdS)aË
        CSS colors have 5 formats to process:
 
         - 6 digit hex code: "#ff23ee"     --> [HTML]{FF23EE}
         - 3 digit hex code: "#f0e"        --> [HTML]{FF00EE}
         - rgba: rgba(128, 255, 0, 0.5)    --> [rgb]{0.502, 1.000, 0.000}
         - rgb: rgb(128, 255, 0,)          --> [rbg]{0.502, 1.000, 0.000}
         - string: red                     --> {red}
 
        Additionally rgb or rgba can be expressed in % which is also parsed.
        rorú#éz[HTML]{r¶NrýéééZrgbz(?<=\()[0-9\s%]+(?=,)ú%r~édéÿz(?<=,)[0-9\s%]+(?=,)Úaz(?<=,)[0-9\s%]+(?=\))z[rgb]{z.3fz, r“)rYÚupperrKÚfindallrcr+r4)    rÕZuser_argrŒÚcomm_argr‰ÚvalrÚgÚbr-r-r.rlÍs"  4(**&z*_parse_latex_css_conversion.<locals>.colorZ    cellcolorr…)rŒr¤rlro)z font-weightrkrlz
font-stylez--latex)rƒr„r…r‡r†N)rrSr%ryr¯r‹r®) r9r—r˜rlZCONVERTED_ATTRIBUTESr€Ú    attributerÕr‰r¸Z latex_styler-r-r.rŠºs,"  ü  rŠcCst| dd¡ dd¡ dd¡ dd¡ d    d
¡ d d ¡ d d¡ dd¡ dd¡ dd¡ dd¡ dd¡ dd¡ dd¡S)al
    Replace the characters ``&``, ``%``, ``$``, ``#``, ``_``, ``{``, ``}``,
    ``~``, ``^``, and ``\`` in the string with LaTeX-safe sequences.
 
    Use this if you need to display text that might contain such characters in LaTeX.
 
    Parameters
    ----------
    s : str
        Input to be escaped
 
    Return
    ------
    str :
        Escaped string
    r‚u ab2§=§8yzu ab2§=§8yz uab2§=§8yz\space ú&z\&ržz\%ú$z\$r™z\#rÌz\_r“z\{rýz\}z~ z~\space ú~z\textasciitilde z^ z^\space ú^z\textasciicircum z\textbackslash )r¯)rVr-r-r.rE    sR ÿþýüûúùø    ÷
ö õ ô óÿrE)NNr*)N)F)NNNrNNN)F)FF)WÚ
__future__rÚ collectionsrÚ    functoolsrrKÚtypingrrrrr    r
r r r rr9rÚnumpyr]Zpandas._configrZ pandas._libsrZpandas._typingrrZpandas.compat._optionalrZpandas.core.dtypes.commonrrrZpandas.core.dtypes.genericrr0rrrrrrZpandas.api.typesrZpandas.core.commonÚcoreÚcommonr½r Z
markupsafer#rDr%Z BaseFormatterZ ExtFormatterr+ZCSSPairr_r'r$r8r rTr/rÎr©r«rÐr¨rPrArFrNrr rerrfrr’r“r”r‹rŠrEr-r-r-r.Ú<module>s’   0           2ú1üQù6+"'ÿ4û7
L