43
43
CSSProperties ,
44
44
CSSStyles ,
45
45
StylerRenderer ,
46
+ Subset ,
46
47
Tooltips ,
47
48
maybe_convert_css_to_tuples ,
48
49
non_reducing_slice ,
@@ -545,7 +546,7 @@ def _apply(
545
546
self ,
546
547
func : Callable [..., Styler ],
547
548
axis : Axis | None = 0 ,
548
- subset = None ,
549
+ subset : Subset | None = None ,
549
550
** kwargs ,
550
551
) -> Styler :
551
552
subset = slice (None ) if subset is None else subset
@@ -590,7 +591,7 @@ def apply(
590
591
self ,
591
592
func : Callable [..., Styler ],
592
593
axis : Axis | None = 0 ,
593
- subset = None ,
594
+ subset : Subset | None = None ,
594
595
** kwargs ,
595
596
) -> Styler :
596
597
"""
@@ -651,7 +652,9 @@ def apply(
651
652
)
652
653
return self
653
654
654
- def _applymap (self , func : Callable , subset = None , ** kwargs ) -> Styler :
655
+ def _applymap (
656
+ self , func : Callable , subset : Subset | None = None , ** kwargs
657
+ ) -> Styler :
655
658
func = partial (func , ** kwargs ) # applymap doesn't take kwargs?
656
659
if subset is None :
657
660
subset = pd .IndexSlice [:]
@@ -660,7 +663,9 @@ def _applymap(self, func: Callable, subset=None, **kwargs) -> Styler:
660
663
self ._update_ctx (result )
661
664
return self
662
665
663
- def applymap (self , func : Callable , subset = None , ** kwargs ) -> Styler :
666
+ def applymap (
667
+ self , func : Callable , subset : Subset | None = None , ** kwargs
668
+ ) -> Styler :
664
669
"""
665
670
Apply a CSS-styling function elementwise.
666
671
@@ -707,7 +712,7 @@ def where(
707
712
cond : Callable ,
708
713
value : str ,
709
714
other : str | None = None ,
710
- subset = None ,
715
+ subset : Subset | None = None ,
711
716
** kwargs ,
712
717
) -> Styler :
713
718
"""
@@ -1061,7 +1066,7 @@ def hide_index(self) -> Styler:
1061
1066
self .hidden_index = True
1062
1067
return self
1063
1068
1064
- def hide_columns (self , subset ) -> Styler :
1069
+ def hide_columns (self , subset : Subset ) -> Styler :
1065
1070
"""
1066
1071
Hide columns from rendering.
1067
1072
@@ -1093,7 +1098,7 @@ def background_gradient(
1093
1098
low : float = 0 ,
1094
1099
high : float = 0 ,
1095
1100
axis : Axis | None = 0 ,
1096
- subset = None ,
1101
+ subset : Subset | None = None ,
1097
1102
text_color_threshold : float = 0.408 ,
1098
1103
vmin : float | None = None ,
1099
1104
vmax : float | None = None ,
@@ -1239,7 +1244,7 @@ def background_gradient(
1239
1244
)
1240
1245
return self
1241
1246
1242
- def set_properties (self , subset = None , ** kwargs ) -> Styler :
1247
+ def set_properties (self , subset : Subset | None = None , ** kwargs ) -> Styler :
1243
1248
"""
1244
1249
Set defined CSS-properties to each ``<td>`` HTML element within the given
1245
1250
subset.
@@ -1331,7 +1336,7 @@ def css(x):
1331
1336
1332
1337
def bar (
1333
1338
self ,
1334
- subset = None ,
1339
+ subset : Subset | None = None ,
1335
1340
axis : Axis | None = 0 ,
1336
1341
color = "#d65f5f" ,
1337
1342
width : float = 100 ,
@@ -1417,7 +1422,7 @@ def bar(
1417
1422
def highlight_null (
1418
1423
self ,
1419
1424
null_color : str = "red" ,
1420
- subset : IndexLabel | None = None ,
1425
+ subset : Subset | None = None ,
1421
1426
props : str | None = None ,
1422
1427
) -> Styler :
1423
1428
"""
@@ -1462,7 +1467,7 @@ def f(data: DataFrame, props: str) -> np.ndarray:
1462
1467
1463
1468
def highlight_max (
1464
1469
self ,
1465
- subset : IndexLabel | None = None ,
1470
+ subset : Subset | None = None ,
1466
1471
color : str = "yellow" ,
1467
1472
axis : Axis | None = 0 ,
1468
1473
props : str | None = None ,
@@ -1511,7 +1516,7 @@ def f(data: FrameOrSeries, props: str) -> np.ndarray:
1511
1516
1512
1517
def highlight_min (
1513
1518
self ,
1514
- subset : IndexLabel | None = None ,
1519
+ subset : Subset | None = None ,
1515
1520
color : str = "yellow" ,
1516
1521
axis : Axis | None = 0 ,
1517
1522
props : str | None = None ,
@@ -1560,7 +1565,7 @@ def f(data: FrameOrSeries, props: str) -> np.ndarray:
1560
1565
1561
1566
def highlight_between (
1562
1567
self ,
1563
- subset : IndexLabel | None = None ,
1568
+ subset : Subset | None = None ,
1564
1569
color : str = "yellow" ,
1565
1570
axis : Axis | None = 0 ,
1566
1571
left : Scalar | Sequence | None = None ,
@@ -1667,7 +1672,7 @@ def highlight_between(
1667
1672
1668
1673
def highlight_quantile (
1669
1674
self ,
1670
- subset : IndexLabel | None = None ,
1675
+ subset : Subset | None = None ,
1671
1676
color : str = "yellow" ,
1672
1677
axis : Axis | None = 0 ,
1673
1678
q_left : float = 0.0 ,
0 commit comments