@@ -1631,12 +1631,12 @@ def highlight_null(
1631
1631
-------
1632
1632
self : Styler
1633
1633
"""
1634
+
1635
+ def f (data : DataFrame , props : str ) -> np .ndarray :
1636
+ return np .where (pd .isna (data ).values , props , "" )
1637
+
1634
1638
return self .apply (
1635
- _Builtins ._highlight_func ,
1636
- axis = None ,
1637
- subset = subset ,
1638
- props = f"background-color: { null_color } ;" ,
1639
- highlight = "null" ,
1639
+ f , axis = None , subset = subset , props = f"background-color: { null_color } ;"
1640
1640
)
1641
1641
1642
1642
def highlight_max (
@@ -1662,12 +1662,12 @@ def highlight_max(
1662
1662
-------
1663
1663
self : Styler
1664
1664
"""
1665
+
1666
+ def f (data : FrameOrSeries , props : str ) -> np .ndarray :
1667
+ return np .where (data == np .nanmax (data .values ), props , "" )
1668
+
1665
1669
return self .apply (
1666
- _Builtins ._highlight_func ,
1667
- axis = axis ,
1668
- subset = subset ,
1669
- props = f"background-color: { color } ;" ,
1670
- highlight = "max" ,
1670
+ f , axis = axis , subset = subset , props = f"background-color: { color } ;"
1671
1671
)
1672
1672
1673
1673
def highlight_min (
@@ -1693,12 +1693,12 @@ def highlight_min(
1693
1693
-------
1694
1694
self : Styler
1695
1695
"""
1696
+
1697
+ def f (data : FrameOrSeries , props : str ) -> np .ndarray :
1698
+ return np .where (data == np .nanmin (data .values ), props , "" )
1699
+
1696
1700
return self .apply (
1697
- _Builtins ._highlight_func ,
1698
- axis = axis ,
1699
- subset = subset ,
1700
- props = f"background-color: { color } ;" ,
1701
- highlight = "min" ,
1701
+ f , axis = axis , subset = subset , props = f"background-color: { color } ;"
1702
1702
)
1703
1703
1704
1704
def highlight_range (
0 commit comments